Mercurial > pidgin.yaz
annotate pidgin/gtkaccount.c @ 31712:8fc25b77295a
Hopefully fixes #13298, the bug about not being able to add MSN buddies.
Here's what I think is happening:
1. Before we add the buddy we issue an FQY request to ask the server what
network the username is for (either normal MSN or Yahoo)
2. When we get the response we add the buddy to our buddy list with the
network ID given to us by the server
3. For some reason the server is now returning a network ID of 0 ("unknown")
instead of 1 ("normal MSN") for normal passport buddies, and we bail out
when we encounter this. QuLogic thinks the server used to return 1 in
this case.
My change is to just not bail out if the FQY response has network ID 0.
Instead of treat 0 as 1 and continue with the add. It looks like our
SOAP request to add the buddy to our address book will fail a big further
down the road if the buddy doesn't exist--so we're still protecting
against that.
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Mon, 28 Feb 2011 08:26:40 +0000 |
parents | a8cc50c2279f |
children | 917c597beb97 |
rev | line source |
---|---|
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2 * @file gtkaccount.c GTK+ Account Editor UI |
16193
247e421c4fa6
Rename the Doxygen group from gtkui to pidgin.
Richard Laager <rlaager@wiktel.com>
parents:
16130
diff
changeset
|
3 * @ingroup pidgin |
20074
6bf32c9e15a7
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents:
19680
diff
changeset
|
4 */ |
6bf32c9e15a7
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents:
19680
diff
changeset
|
5 |
6bf32c9e15a7
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents:
19680
diff
changeset
|
6 /* pidgin |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7 * |
15871
66dff3dfdea6
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
8 * Pidgin is the legal property of its developers, whose names are too numerous |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
9 * to list here. Please refer to the COPYRIGHT file distributed with this |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
10 * source distribution. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
11 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
12 * This program is free software; you can redistribute it and/or modify |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
13 * it under the terms of the GNU General Public License as published by |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
14 * the Free Software Foundation; either version 2 of the License, or |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
15 * (at your option) any later version. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
16 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
17 * This program is distributed in the hope that it will be useful, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
20 * GNU General Public License for more details. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
21 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
22 * You should have received a copy of the GNU General Public License |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
23 * along with this program; if not, write to the Free Software |
19680
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19610
diff
changeset
|
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
25 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
26 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
27 #include "internal.h" |
15514 | 28 #include "pidgin.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
29 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
30 #include "account.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
31 #include "accountopt.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
32 #include "core.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
33 #include "debug.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
34 #include "notify.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
35 #include "plugin.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
36 #include "prefs.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
37 #include "prpl.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
38 #include "request.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
39 #include "savedstatuses.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
40 #include "signals.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
41 #include "util.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
42 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
43 #include "gtkaccount.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
44 #include "gtkblist.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
45 #include "gtkdialogs.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
46 #include "gtkutils.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
47 #include "gtkstatusbox.h" |
15822
84b0f9b23ede
According to etags, pidgin/ should be completely clean of references to 'gaim' as a client
Sean Egan <seanegan@gmail.com>
parents:
15821
diff
changeset
|
48 #include "pidginstock.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
49 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
50 enum |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
51 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
52 COLUMN_ICON, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
53 COLUMN_BUDDYICON, |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
54 COLUMN_USERNAME, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
55 COLUMN_ENABLED, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
56 COLUMN_PROTOCOL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
57 COLUMN_DATA, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
58 NUM_COLUMNS |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
59 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
60 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
61 typedef struct |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
62 { |
15823 | 63 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
64 char *username; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
65 char *alias; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
66 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
67 } PidginAccountAddUserData; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
68 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
69 typedef struct |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
70 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
71 GtkWidget *window; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
72 GtkWidget *treeview; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
73 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
74 GtkWidget *modify_button; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
75 GtkWidget *delete_button; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
76 GtkWidget *notebook; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
77 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
78 GtkListStore *model; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
79 GtkTreeIter drag_iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
80 |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
81 GtkTreeViewColumn *username_col; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
82 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
83 } AccountsWindow; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
84 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
85 typedef struct |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
86 { |
24980
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
87 GtkWidget *widget; |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
88 gchar *setting; |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
89 PurplePrefType type; |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
90 } ProtocolOptEntry; |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
91 |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
92 typedef struct |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
93 { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
94 PidginAccountDialogType type; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
95 |
15823 | 96 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
97 char *protocol_id; |
15823 | 98 PurplePlugin *plugin; |
99 PurplePluginProtocolInfo *prpl_info; | |
100 | |
101 PurpleProxyType new_proxy_type; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
102 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
103 GList *user_split_entries; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
104 GList *protocol_opt_entries; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
105 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
106 GtkSizeGroup *sg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
107 GtkWidget *window; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
108 |
26293
dc3258ad4462
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26279
diff
changeset
|
109 GtkWidget *notebook; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
110 GtkWidget *top_vbox; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
111 GtkWidget *ok_button; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
112 GtkWidget *register_button; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
113 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
114 /* Login Options */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
115 GtkWidget *login_frame; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
116 GtkWidget *protocol_menu; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
117 GtkWidget *password_box; |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
118 GtkWidget *username_entry; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
119 GtkWidget *password_entry; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
120 GtkWidget *alias_entry; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
121 GtkWidget *remember_pass_check; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
122 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
123 /* User Options */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
124 GtkWidget *user_frame; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
125 GtkWidget *new_mail_check; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
126 GtkWidget *icon_hbox; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
127 GtkWidget *icon_check; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
128 GtkWidget *icon_entry; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
129 GtkWidget *icon_filesel; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
130 GtkWidget *icon_preview; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
131 GtkWidget *icon_text; |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
132 PurpleStoredImage *icon_img; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
133 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
134 /* Protocol Options */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
135 GtkWidget *protocol_frame; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
136 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
137 /* Proxy Options */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
138 GtkWidget *proxy_frame; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
139 GtkWidget *proxy_vbox; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
140 GtkWidget *proxy_dropdown; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
141 GtkWidget *proxy_host_entry; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
142 GtkWidget *proxy_port_entry; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
143 GtkWidget *proxy_user_entry; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
144 GtkWidget *proxy_pass_entry; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
145 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
146 } AccountPrefsDialog; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
147 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
148 static AccountsWindow *accounts_window = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
149 static GHashTable *account_pref_wins; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
150 |
15823 | 151 static void add_account_to_liststore(PurpleAccount *account, gpointer user_data); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
152 static void set_account(GtkListStore *store, GtkTreeIter *iter, |
15823 | 153 PurpleAccount *account, GdkPixbuf *global_buddyicon); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
154 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
155 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
156 * Add/Modify Account dialog |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
157 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
158 static void add_login_options(AccountPrefsDialog *dialog, GtkWidget *parent); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
159 static void add_user_options(AccountPrefsDialog *dialog, GtkWidget *parent); |
26293
dc3258ad4462
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26279
diff
changeset
|
160 static void add_protocol_options(AccountPrefsDialog *dialog); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
161 static void add_proxy_options(AccountPrefsDialog *dialog, GtkWidget *parent); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
162 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
163 static GtkWidget * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
164 add_pref_box(AccountPrefsDialog *dialog, GtkWidget *parent, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
165 const char *text, GtkWidget *widget) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
166 { |
21992
1690d040addd
Remove a lot of duplication from a lot of places. Closes #4558.
Gabriel Schulhof <nix@go-nix.ca>
parents:
21938
diff
changeset
|
167 return pidgin_add_widget_to_vbox(GTK_BOX(parent), text, dialog->sg, widget, TRUE, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
168 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
169 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
170 static void |
16597
bc03699814a1
Part of the patch in ticket #383:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16483
diff
changeset
|
171 set_dialog_icon(AccountPrefsDialog *dialog, gpointer data, size_t len, gchar *new_icon_path) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
172 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
173 GdkPixbuf *pixbuf = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
174 |
16597
bc03699814a1
Part of the patch in ticket #383:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16483
diff
changeset
|
175 dialog->icon_img = purple_imgstore_unref(dialog->icon_img); |
16391
24bbd7e46bfe
Change the imgstore and by extension, then the buddy icon code to take over
Richard Laager <rlaager@wiktel.com>
parents:
16390
diff
changeset
|
176 if (data != NULL) |
16482
3be560001d26
Kill some compiler warnings and TODOs of mine.
Richard Laager <rlaager@wiktel.com>
parents:
16391
diff
changeset
|
177 { |
16391
24bbd7e46bfe
Change the imgstore and by extension, then the buddy icon code to take over
Richard Laager <rlaager@wiktel.com>
parents:
16390
diff
changeset
|
178 if (len > 0) |
24bbd7e46bfe
Change the imgstore and by extension, then the buddy icon code to take over
Richard Laager <rlaager@wiktel.com>
parents:
16390
diff
changeset
|
179 dialog->icon_img = purple_imgstore_add(data, len, new_icon_path); |
24bbd7e46bfe
Change the imgstore and by extension, then the buddy icon code to take over
Richard Laager <rlaager@wiktel.com>
parents:
16390
diff
changeset
|
180 else |
24bbd7e46bfe
Change the imgstore and by extension, then the buddy icon code to take over
Richard Laager <rlaager@wiktel.com>
parents:
16390
diff
changeset
|
181 g_free(data); |
16482
3be560001d26
Kill some compiler warnings and TODOs of mine.
Richard Laager <rlaager@wiktel.com>
parents:
16391
diff
changeset
|
182 } |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
183 |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
184 if (dialog->icon_img != NULL) { |
23128
ce984959bda0
Add a utility function to create a pixbuf from a stored image.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22313
diff
changeset
|
185 pixbuf = pidgin_pixbuf_from_imgstore(dialog->icon_img); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
186 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
187 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
188 if (pixbuf && dialog->prpl_info && |
15823 | 189 (dialog->prpl_info->icon_spec.scale_rules & PURPLE_ICON_SCALE_DISPLAY)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
190 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
191 /* Scale the icon to something reasonable */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
192 int width, height; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
193 GdkPixbuf *scale; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
194 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
195 pidgin_buddy_icon_get_scale_size(pixbuf, &dialog->prpl_info->icon_spec, |
15823 | 196 PURPLE_ICON_SCALE_DISPLAY, &width, &height); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
197 scale = gdk_pixbuf_scale_simple(pixbuf, width, height, GDK_INTERP_BILINEAR); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
198 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
199 g_object_unref(G_OBJECT(pixbuf)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
200 pixbuf = scale; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
201 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
202 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
203 if (pixbuf == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
204 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
205 /* Show a placeholder icon */ |
16301
c5a8103aa9a4
New select-avatar image from hbons
Stu Tomlinson <stu@nosnilmot.com>
parents:
16270
diff
changeset
|
206 GtkIconSize icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_SMALL); |
c5a8103aa9a4
New select-avatar image from hbons
Stu Tomlinson <stu@nosnilmot.com>
parents:
16270
diff
changeset
|
207 pixbuf = gtk_widget_render_icon(dialog->window, PIDGIN_STOCK_TOOLBAR_SELECT_AVATAR, |
16270 | 208 icon_size, "PidginAccount"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
209 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
210 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
211 gtk_image_set_from_pixbuf(GTK_IMAGE(dialog->icon_entry), pixbuf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
212 if (pixbuf != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
213 g_object_unref(G_OBJECT(pixbuf)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
214 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
215 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
216 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
217 set_account_protocol_cb(GtkWidget *item, const char *id, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
218 AccountPrefsDialog *dialog) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
219 { |
15823 | 220 PurplePlugin *new_plugin; |
221 | |
222 new_plugin = purple_find_prpl(id); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
223 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
224 dialog->plugin = new_plugin; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
225 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
226 if (dialog->plugin != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
227 { |
15823 | 228 dialog->prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(dialog->plugin); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
229 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
230 g_free(dialog->protocol_id); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
231 dialog->protocol_id = g_strdup(dialog->plugin->info->id); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
232 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
233 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
234 if (dialog->account != NULL) |
15823 | 235 purple_account_clear_settings(dialog->account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
236 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
237 add_login_options(dialog, dialog->top_vbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
238 add_user_options(dialog, dialog->top_vbox); |
26293
dc3258ad4462
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26279
diff
changeset
|
239 add_protocol_options(dialog); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
240 |
20197
5d3b4da9b084
applied changes from bb3c9dec65d16afdcc4bcedd5fd184b7207cc624
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
241 gtk_widget_grab_focus(dialog->protocol_menu); |
5d3b4da9b084
applied changes from bb3c9dec65d16afdcc4bcedd5fd184b7207cc624
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
242 |
22054
658785fe1992
This makes authorization requests go away when the account is disconnected. It will leak the protocol's user_data, but without an API change, there isn't much that can be done about that. References #4609
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21992
diff
changeset
|
243 if (!dialog->prpl_info || !dialog->prpl_info->register_user || |
19395
8ce97365b418
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@gmail.com>
parents:
18829
diff
changeset
|
244 g_object_get_data(G_OBJECT(item), "fake")) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
245 gtk_widget_hide(dialog->register_button); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
246 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
247 if (dialog->prpl_info != NULL && |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
248 (dialog->prpl_info->options & OPT_PROTO_REGISTER_NOSCREENNAME)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
249 gtk_widget_set_sensitive(dialog->register_button, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
250 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
251 gtk_widget_set_sensitive(dialog->register_button, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
252 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
253 gtk_widget_show(dialog->register_button); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
254 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
255 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
256 |
23112
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
257 static gboolean |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
258 username_focus_cb(GtkWidget *widget, GdkEventFocus *event, AccountPrefsDialog *dialog) |
23112
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
259 { |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
260 GHashTable *table; |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
261 const char *label; |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
262 |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
263 table = dialog->prpl_info->get_account_text_table(NULL); |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
264 label = g_hash_table_lookup(table, "login_label"); |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
265 |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
266 if(!strcmp(gtk_entry_get_text(GTK_ENTRY(widget)), label)) { |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
267 gtk_entry_set_text(GTK_ENTRY(widget), ""); |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
268 gtk_widget_modify_text(widget, GTK_STATE_NORMAL,NULL); |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
269 } |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
270 |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
271 g_hash_table_destroy(table); |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
272 |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
273 return FALSE; |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
274 } |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
275 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
276 static void |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
277 username_changed_cb(GtkEntry *entry, AccountPrefsDialog *dialog) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
278 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
279 if (dialog->ok_button) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
280 gtk_widget_set_sensitive(dialog->ok_button, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
281 *gtk_entry_get_text(entry) != '\0'); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
282 if (dialog->register_button) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
283 if (dialog->prpl_info != NULL && (dialog->prpl_info->options & OPT_PROTO_REGISTER_NOSCREENNAME)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
284 gtk_widget_set_sensitive(dialog->register_button, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
285 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
286 gtk_widget_set_sensitive(dialog->register_button, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
287 *gtk_entry_get_text(entry) != '\0'); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
288 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
289 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
290 |
23112
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
291 static gboolean |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
292 username_nofocus_cb(GtkWidget *widget, GdkEventFocus *event, AccountPrefsDialog *dialog) |
23112
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
293 { |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
294 GdkColor color = {0, 34952, 35466, 34181}; |
24848
2ce759d9176a
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24541
diff
changeset
|
295 GHashTable *table = NULL; |
2ce759d9176a
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24541
diff
changeset
|
296 const char *label = NULL; |
2ce759d9176a
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24541
diff
changeset
|
297 |
2ce759d9176a
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24541
diff
changeset
|
298 if(PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(dialog->prpl_info, get_account_text_table)) { |
2ce759d9176a
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24541
diff
changeset
|
299 table = dialog->prpl_info->get_account_text_table(NULL); |
2ce759d9176a
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24541
diff
changeset
|
300 label = g_hash_table_lookup(table, "login_label"); |
2ce759d9176a
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24541
diff
changeset
|
301 |
2ce759d9176a
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24541
diff
changeset
|
302 if (*gtk_entry_get_text(GTK_ENTRY(widget)) == '\0') { |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
303 /* We have to avoid hitting the username_changed_cb function |
24848
2ce759d9176a
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24541
diff
changeset
|
304 * because it enables buttons we don't want enabled yet ;) |
2ce759d9176a
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24541
diff
changeset
|
305 */ |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
306 g_signal_handlers_block_by_func(widget, G_CALLBACK(username_changed_cb), dialog); |
24848
2ce759d9176a
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24541
diff
changeset
|
307 gtk_entry_set_text(GTK_ENTRY(widget), label); |
2ce759d9176a
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24541
diff
changeset
|
308 /* Make sure we can hit it again */ |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
309 g_signal_handlers_unblock_by_func(widget, G_CALLBACK(username_changed_cb), dialog); |
24848
2ce759d9176a
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24541
diff
changeset
|
310 gtk_widget_modify_text(widget, GTK_STATE_NORMAL, &color); |
2ce759d9176a
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24541
diff
changeset
|
311 } |
2ce759d9176a
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24541
diff
changeset
|
312 |
2ce759d9176a
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24541
diff
changeset
|
313 g_hash_table_destroy(table); |
23112
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
314 } |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
315 |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
316 return FALSE; |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
317 } |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
318 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
319 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
320 icon_filesel_choose_cb(const char *filename, gpointer data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
321 { |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
322 AccountPrefsDialog *dialog = data; |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
323 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
324 if (filename != NULL) |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
325 { |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
326 size_t len; |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
327 gpointer data = pidgin_convert_buddy_icon(dialog->plugin, filename, &len); |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
328 set_dialog_icon(dialog, data, len, g_strdup(filename)); |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
329 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
330 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
331 dialog->icon_filesel = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
332 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
333 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
334 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
335 icon_select_cb(GtkWidget *button, AccountPrefsDialog *dialog) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
336 { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
337 dialog->icon_filesel = pidgin_buddy_icon_chooser_new(GTK_WINDOW(dialog->window), icon_filesel_choose_cb, dialog); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
338 gtk_widget_show_all(dialog->icon_filesel); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
339 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
340 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
341 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
342 icon_reset_cb(GtkWidget *button, AccountPrefsDialog *dialog) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
343 { |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
344 set_dialog_icon(dialog, NULL, 0, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
345 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
346 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
347 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
348 account_dnd_recv(GtkWidget *widget, GdkDragContext *dc, gint x, gint y, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
349 GtkSelectionData *sd, guint info, guint t, AccountPrefsDialog *dialog) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
350 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
351 gchar *name = (gchar *)sd->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
352 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
353 if ((sd->length >= 0) && (sd->format == 8)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
354 /* Well, it looks like the drag event was cool. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
355 * Let's do something with it */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
356 if (!g_ascii_strncasecmp(name, "file://", 7)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
357 GError *converr = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
358 gchar *tmp, *rtmp; |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
359 gpointer data; |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
360 size_t len; |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
361 |
16344
a45cb71d54db
A comment in here mentions "untar", so I think it was copied from the
Richard Laager <rlaager@wiktel.com>
parents:
16301
diff
changeset
|
362 /* It looks like we're dealing with a local file. */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
363 if(!(tmp = g_filename_from_uri(name, NULL, &converr))) { |
15823 | 364 purple_debug(PURPLE_DEBUG_ERROR, "buddyicon", "%s\n", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
365 (converr ? converr->message : |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
366 "g_filename_from_uri error")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
367 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
368 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
369 if ((rtmp = strchr(tmp, '\r')) || (rtmp = strchr(tmp, '\n'))) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
370 *rtmp = '\0'; |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
371 |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
372 data = pidgin_convert_buddy_icon(dialog->plugin, tmp, &len); |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
373 /* This takes ownership of tmp */ |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
374 set_dialog_icon(dialog, data, len, tmp); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
375 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
376 gtk_drag_finish(dc, TRUE, FALSE, t); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
377 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
378 gtk_drag_finish(dc, FALSE, FALSE, t); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
379 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
380 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
381 static void |
15823 | 382 update_editable(PurpleConnection *gc, AccountPrefsDialog *dialog) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
383 { |
29292
d69df70937cc
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27492
diff
changeset
|
384 GtkStyle *style; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
385 gboolean set; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
386 GList *l; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
387 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
388 if (dialog->account == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
389 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
390 |
15823 | 391 if (gc != NULL && dialog->account != purple_connection_get_account(gc)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
392 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
393 |
15823 | 394 set = !(purple_account_is_connected(dialog->account) || purple_account_is_connecting(dialog->account)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
395 gtk_widget_set_sensitive(dialog->protocol_menu, set); |
29292
d69df70937cc
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27492
diff
changeset
|
396 gtk_editable_set_editable(GTK_EDITABLE(dialog->username_entry), set); |
d69df70937cc
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27492
diff
changeset
|
397 style = set ? NULL : gtk_widget_get_style(dialog->username_entry); |
d69df70937cc
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27492
diff
changeset
|
398 gtk_widget_modify_base(dialog->username_entry, GTK_STATE_NORMAL, |
d69df70937cc
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27492
diff
changeset
|
399 style ? &style->base[GTK_STATE_INSENSITIVE] : NULL); |
d69df70937cc
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27492
diff
changeset
|
400 |
d69df70937cc
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27492
diff
changeset
|
401 for (l = dialog->user_split_entries ; l != NULL ; l = l->next) { |
d69df70937cc
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27492
diff
changeset
|
402 if (GTK_IS_EDITABLE(l->data)) { |
d69df70937cc
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27492
diff
changeset
|
403 gtk_editable_set_editable(GTK_EDITABLE(l->data), set); |
d69df70937cc
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27492
diff
changeset
|
404 style = set ? NULL : gtk_widget_get_style(GTK_WIDGET(l->data)); |
d69df70937cc
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27492
diff
changeset
|
405 gtk_widget_modify_base(GTK_WIDGET(l->data), GTK_STATE_NORMAL, |
d69df70937cc
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27492
diff
changeset
|
406 style ? &style->base[GTK_STATE_INSENSITIVE] : NULL); |
d69df70937cc
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27492
diff
changeset
|
407 } else { |
d69df70937cc
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27492
diff
changeset
|
408 gtk_widget_set_sensitive(GTK_WIDGET(l->data), set); |
d69df70937cc
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27492
diff
changeset
|
409 } |
d69df70937cc
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27492
diff
changeset
|
410 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
411 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
412 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
413 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
414 add_login_options(AccountPrefsDialog *dialog, GtkWidget *parent) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
415 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
416 GtkWidget *frame; |
16983
dfcc9b337595
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@wiktel.com>
parents:
16847
diff
changeset
|
417 GtkWidget *hbox; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
418 GtkWidget *vbox; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
419 GtkWidget *entry; |
17261
9ca9f87b4b47
Use gmail.com as the default domain for Google Talk accounts
Sean Egan <seanegan@gmail.com>
parents:
16983
diff
changeset
|
420 GtkWidget *menu; |
9ca9f87b4b47
Use gmail.com as the default domain for Google Talk accounts
Sean Egan <seanegan@gmail.com>
parents:
16983
diff
changeset
|
421 GtkWidget *item; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
422 GList *user_splits; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
423 GList *l, *l2; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
424 char *username = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
425 |
16983
dfcc9b337595
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@wiktel.com>
parents:
16847
diff
changeset
|
426 if (dialog->protocol_menu != NULL) |
dfcc9b337595
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@wiktel.com>
parents:
16847
diff
changeset
|
427 { |
26705
a3f7ade9e45b
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26293
diff
changeset
|
428 #if GTK_CHECK_VERSION(2,12,0) |
a3f7ade9e45b
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26293
diff
changeset
|
429 g_object_ref(G_OBJECT(dialog->protocol_menu)); |
a3f7ade9e45b
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26293
diff
changeset
|
430 #else |
16983
dfcc9b337595
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@wiktel.com>
parents:
16847
diff
changeset
|
431 gtk_widget_ref(dialog->protocol_menu); |
26705
a3f7ade9e45b
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26293
diff
changeset
|
432 #endif |
16983
dfcc9b337595
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@wiktel.com>
parents:
16847
diff
changeset
|
433 hbox = g_object_get_data(G_OBJECT(dialog->protocol_menu), "container"); |
dfcc9b337595
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@wiktel.com>
parents:
16847
diff
changeset
|
434 gtk_container_remove(GTK_CONTAINER(hbox), dialog->protocol_menu); |
dfcc9b337595
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@wiktel.com>
parents:
16847
diff
changeset
|
435 } |
dfcc9b337595
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@wiktel.com>
parents:
16847
diff
changeset
|
436 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
437 if (dialog->login_frame != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
438 gtk_widget_destroy(dialog->login_frame); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
439 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
440 /* Build the login options frame. */ |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
441 frame = pidgin_make_frame(parent, _("Login Options")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
442 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
443 /* cringe */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
444 dialog->login_frame = gtk_widget_get_parent(gtk_widget_get_parent(frame)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
445 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
446 gtk_box_reorder_child(GTK_BOX(parent), dialog->login_frame, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
447 gtk_widget_show(dialog->login_frame); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
448 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
449 /* Main vbox */ |
15821 | 450 vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
451 gtk_container_add(GTK_CONTAINER(frame), vbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
452 gtk_widget_show(vbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
453 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
454 /* Protocol */ |
16983
dfcc9b337595
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@wiktel.com>
parents:
16847
diff
changeset
|
455 if (dialog->protocol_menu == NULL) |
dfcc9b337595
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@wiktel.com>
parents:
16847
diff
changeset
|
456 { |
dfcc9b337595
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@wiktel.com>
parents:
16847
diff
changeset
|
457 dialog->protocol_menu = pidgin_protocol_option_menu_new( |
dfcc9b337595
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@wiktel.com>
parents:
16847
diff
changeset
|
458 dialog->protocol_id, G_CALLBACK(set_account_protocol_cb), dialog); |
26705
a3f7ade9e45b
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26293
diff
changeset
|
459 #if GTK_CHECK_VERSION(2,12,0) |
a3f7ade9e45b
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26293
diff
changeset
|
460 g_object_ref(G_OBJECT(dialog->protocol_menu)); |
a3f7ade9e45b
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26293
diff
changeset
|
461 #else |
16983
dfcc9b337595
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@wiktel.com>
parents:
16847
diff
changeset
|
462 gtk_widget_ref(dialog->protocol_menu); |
26705
a3f7ade9e45b
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26293
diff
changeset
|
463 #endif |
16983
dfcc9b337595
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@wiktel.com>
parents:
16847
diff
changeset
|
464 } |
dfcc9b337595
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@wiktel.com>
parents:
16847
diff
changeset
|
465 |
17696
0d65b1438d99
Add some mnemonics to the new/modify account dialog. These are also taken
Stu Tomlinson <stu@nosnilmot.com>
parents:
17695
diff
changeset
|
466 hbox = add_pref_box(dialog, vbox, _("Pro_tocol:"), dialog->protocol_menu); |
16983
dfcc9b337595
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@wiktel.com>
parents:
16847
diff
changeset
|
467 g_object_set_data(G_OBJECT(dialog->protocol_menu), "container", hbox); |
dfcc9b337595
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@wiktel.com>
parents:
16847
diff
changeset
|
468 |
26705
a3f7ade9e45b
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26293
diff
changeset
|
469 #if GTK_CHECK_VERSION(2,12,0) |
a3f7ade9e45b
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26293
diff
changeset
|
470 g_object_unref(G_OBJECT(dialog->protocol_menu)); |
a3f7ade9e45b
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26293
diff
changeset
|
471 #else |
16983
dfcc9b337595
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@wiktel.com>
parents:
16847
diff
changeset
|
472 gtk_widget_unref(dialog->protocol_menu); |
26705
a3f7ade9e45b
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26293
diff
changeset
|
473 #endif |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
474 |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
475 /* Username */ |
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
476 dialog->username_entry = gtk_entry_new(); |
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
477 g_object_set(G_OBJECT(dialog->username_entry), "truncate-multiline", TRUE, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
478 |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
479 add_pref_box(dialog, vbox, _("_Username:"), dialog->username_entry); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
480 |
23112
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
481 if (dialog->account != NULL) |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
482 username = g_strdup(purple_account_get_username(dialog->account)); |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
483 |
24157
9c8d73b0f27c
Fix NULL pointer deref. Fixes #7258. Thanks to "jonassa" for noticing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24137
diff
changeset
|
484 if (!username && dialog->prpl_info |
9c8d73b0f27c
Fix NULL pointer deref. Fixes #7258. Thanks to "jonassa" for noticing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24137
diff
changeset
|
485 && PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(dialog->prpl_info, get_account_text_table)) { |
23112
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
486 GdkColor color = {0, 34952, 35466, 34181}; |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
487 GHashTable *table; |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
488 const char *label; |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
489 table = dialog->prpl_info->get_account_text_table(NULL); |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
490 label = g_hash_table_lookup(table, "login_label"); |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
491 |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
492 gtk_entry_set_text(GTK_ENTRY(dialog->username_entry), label); |
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
493 g_signal_connect(G_OBJECT(dialog->username_entry), "focus-in-event", |
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
494 G_CALLBACK(username_focus_cb), dialog); |
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
495 g_signal_connect(G_OBJECT(dialog->username_entry), "focus-out-event", |
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
496 G_CALLBACK(username_nofocus_cb), dialog); |
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
497 gtk_widget_modify_text(dialog->username_entry, GTK_STATE_NORMAL, &color); |
23112
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
498 g_hash_table_destroy(table); |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
499 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
500 |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
501 g_signal_connect(G_OBJECT(dialog->username_entry), "changed", |
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
502 G_CALLBACK(username_changed_cb), dialog); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
503 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
504 /* Do the user split thang */ |
24358 | 505 if (dialog->prpl_info == NULL) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
506 user_splits = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
507 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
508 user_splits = dialog->prpl_info->user_splits; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
509 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
510 if (dialog->user_split_entries != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
511 g_list_free(dialog->user_split_entries); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
512 dialog->user_split_entries = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
513 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
514 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
515 for (l = user_splits; l != NULL; l = l->next) { |
15823 | 516 PurpleAccountUserSplit *split = l->data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
517 char *buf; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
518 |
17803
d5fa6c45045e
Add mnemonics to prpl provided account options, from OpenSolaris patch
Stu Tomlinson <stu@nosnilmot.com>
parents:
17784
diff
changeset
|
519 buf = g_strdup_printf("_%s:", purple_account_user_split_get_text(split)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
520 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
521 entry = gtk_entry_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
522 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
523 add_pref_box(dialog, vbox, buf, entry); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
524 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
525 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
526 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
527 dialog->user_split_entries = |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
528 g_list_append(dialog->user_split_entries, entry); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
529 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
530 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
531 for (l = g_list_last(dialog->user_split_entries), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
532 l2 = g_list_last(user_splits); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
533 l != NULL && l2 != NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
534 l = l->prev, l2 = l2->prev) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
535 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
536 GtkWidget *entry = l->data; |
15823 | 537 PurpleAccountUserSplit *split = l2->data; |
17526
8bc2b7ec45c1
Make sure if some plugin used pidgin_protocol_option_menu_new, they continue
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17262
diff
changeset
|
538 const char *value = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
539 char *c; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
540 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
541 if (dialog->account != NULL) { |
18037
e3e42a99070e
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
18034
diff
changeset
|
542 if(purple_account_user_split_get_reverse(split)) |
e3e42a99070e
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
18034
diff
changeset
|
543 c = strrchr(username, |
e3e42a99070e
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
18034
diff
changeset
|
544 purple_account_user_split_get_separator(split)); |
e3e42a99070e
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
18034
diff
changeset
|
545 else |
e3e42a99070e
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
18034
diff
changeset
|
546 c = strchr(username, |
15823 | 547 purple_account_user_split_get_separator(split)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
548 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
549 if (c != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
550 *c = '\0'; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
551 c++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
552 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
553 value = c; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
554 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
555 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
556 if (value == NULL) |
15823 | 557 value = purple_account_user_split_get_default_value(split); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
558 |
17261
9ca9f87b4b47
Use gmail.com as the default domain for Google Talk accounts
Sean Egan <seanegan@gmail.com>
parents:
16983
diff
changeset
|
559 /* Google Talk default domain hackery! */ |
9ca9f87b4b47
Use gmail.com as the default domain for Google Talk accounts
Sean Egan <seanegan@gmail.com>
parents:
16983
diff
changeset
|
560 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(dialog->protocol_menu)); |
9ca9f87b4b47
Use gmail.com as the default domain for Google Talk accounts
Sean Egan <seanegan@gmail.com>
parents:
16983
diff
changeset
|
561 item = gtk_menu_get_active(GTK_MENU(menu)); |
31460
695b6e57e255
UI hack ala Google Talk for Facebook.
Stu Tomlinson <stu@nosnilmot.com>
parents:
31075
diff
changeset
|
562 if (value == NULL && g_object_get_data(G_OBJECT(item), "fakegoogle") && |
17261
9ca9f87b4b47
Use gmail.com as the default domain for Google Talk accounts
Sean Egan <seanegan@gmail.com>
parents:
16983
diff
changeset
|
563 !strcmp(purple_account_user_split_get_text(split), _("Domain"))) |
9ca9f87b4b47
Use gmail.com as the default domain for Google Talk accounts
Sean Egan <seanegan@gmail.com>
parents:
16983
diff
changeset
|
564 value = "gmail.com"; |
9ca9f87b4b47
Use gmail.com as the default domain for Google Talk accounts
Sean Egan <seanegan@gmail.com>
parents:
16983
diff
changeset
|
565 |
31460
695b6e57e255
UI hack ala Google Talk for Facebook.
Stu Tomlinson <stu@nosnilmot.com>
parents:
31075
diff
changeset
|
566 if (value == NULL && g_object_get_data(G_OBJECT(item), "fakefacebook") && |
695b6e57e255
UI hack ala Google Talk for Facebook.
Stu Tomlinson <stu@nosnilmot.com>
parents:
31075
diff
changeset
|
567 !strcmp(purple_account_user_split_get_text(split), _("Domain"))) |
695b6e57e255
UI hack ala Google Talk for Facebook.
Stu Tomlinson <stu@nosnilmot.com>
parents:
31075
diff
changeset
|
568 value = "chat.facebook.com"; |
695b6e57e255
UI hack ala Google Talk for Facebook.
Stu Tomlinson <stu@nosnilmot.com>
parents:
31075
diff
changeset
|
569 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
570 if (value != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
571 gtk_entry_set_text(GTK_ENTRY(entry), value); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
572 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
573 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
574 if (username != NULL) |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
575 gtk_entry_set_text(GTK_ENTRY(dialog->username_entry), username); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
576 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
577 g_free(username); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
578 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
579 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
580 /* Password */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
581 dialog->password_entry = gtk_entry_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
582 gtk_entry_set_visibility(GTK_ENTRY(dialog->password_entry), FALSE); |
24987
17b840986607
GTK+ 2.16.0 will set the invisible character to a nice bullet instead of
Mark Doliner <mark@kingant.net>
parents:
24980
diff
changeset
|
583 #if !GTK_CHECK_VERSION(2,16,0) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
584 if (gtk_entry_get_invisible_char(GTK_ENTRY(dialog->password_entry)) == '*') |
15821 | 585 gtk_entry_set_invisible_char(GTK_ENTRY(dialog->password_entry), PIDGIN_INVISIBLE_CHAR); |
24987
17b840986607
GTK+ 2.16.0 will set the invisible character to a nice bullet instead of
Mark Doliner <mark@kingant.net>
parents:
24980
diff
changeset
|
586 #endif /* Less than GTK+ 2.16 */ |
17696
0d65b1438d99
Add some mnemonics to the new/modify account dialog. These are also taken
Stu Tomlinson <stu@nosnilmot.com>
parents:
17695
diff
changeset
|
587 dialog->password_box = add_pref_box(dialog, vbox, _("_Password:"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
588 dialog->password_entry); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
589 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
590 /* Remember Password */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
591 dialog->remember_pass_check = |
17696
0d65b1438d99
Add some mnemonics to the new/modify account dialog. These are also taken
Stu Tomlinson <stu@nosnilmot.com>
parents:
17695
diff
changeset
|
592 gtk_check_button_new_with_mnemonic(_("Remember pass_word")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
593 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->remember_pass_check), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
594 FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
595 gtk_box_pack_start(GTK_BOX(vbox), dialog->remember_pass_check, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
596 FALSE, FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
597 gtk_widget_show(dialog->remember_pass_check); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
598 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
599 /* Set the fields. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
600 if (dialog->account != NULL) { |
24300
f108d707b6e1
Don't populate the password field on the modify account dialog if we are
Stu Tomlinson <stu@nosnilmot.com>
parents:
24157
diff
changeset
|
601 if (purple_account_get_password(dialog->account) && |
f108d707b6e1
Don't populate the password field on the modify account dialog if we are
Stu Tomlinson <stu@nosnilmot.com>
parents:
24157
diff
changeset
|
602 purple_account_get_remember_password(dialog->account)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
603 gtk_entry_set_text(GTK_ENTRY(dialog->password_entry), |
15823 | 604 purple_account_get_password(dialog->account)); |
605 | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
606 gtk_toggle_button_set_active( |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
607 GTK_TOGGLE_BUTTON(dialog->remember_pass_check), |
15823 | 608 purple_account_get_remember_password(dialog->account)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
609 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
610 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
611 if (dialog->prpl_info != NULL && |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
612 (dialog->prpl_info->options & OPT_PROTO_NO_PASSWORD)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
613 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
614 gtk_widget_hide(dialog->password_box); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
615 gtk_widget_hide(dialog->remember_pass_check); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
616 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
617 |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
618 /* Do not let the user change the protocol/username while connected. */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
619 update_editable(NULL, dialog); |
15823 | 620 purple_signal_connect(purple_connections_get_handle(), "signing-on", dialog, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
621 G_CALLBACK(update_editable), dialog); |
15823 | 622 purple_signal_connect(purple_connections_get_handle(), "signed-off", dialog, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
623 G_CALLBACK(update_editable), dialog); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
624 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
625 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
626 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
627 icon_check_cb(GtkWidget *checkbox, AccountPrefsDialog *dialog) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
628 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
629 gtk_widget_set_sensitive(dialog->icon_hbox, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->icon_check))); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
630 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
631 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
632 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
633 add_user_options(AccountPrefsDialog *dialog, GtkWidget *parent) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
634 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
635 GtkWidget *frame; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
636 GtkWidget *vbox; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
637 GtkWidget *vbox2; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
638 GtkWidget *hbox; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
639 GtkWidget *hbox2; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
640 GtkWidget *button; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
641 GtkWidget *label; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
642 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
643 if (dialog->user_frame != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
644 gtk_widget_destroy(dialog->user_frame); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
645 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
646 /* Build the user options frame. */ |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
647 frame = pidgin_make_frame(parent, _("User Options")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
648 dialog->user_frame = gtk_widget_get_parent(gtk_widget_get_parent(frame)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
649 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
650 gtk_box_reorder_child(GTK_BOX(parent), dialog->user_frame, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
651 gtk_widget_show(dialog->user_frame); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
652 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
653 /* Main vbox */ |
15821 | 654 vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
655 gtk_container_add(GTK_CONTAINER(frame), vbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
656 gtk_widget_show(vbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
657 |
22763
b7847aa66150
Move the Local Alias field into the User Options section of the account
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22313
diff
changeset
|
658 /* Alias */ |
b7847aa66150
Move the Local Alias field into the User Options section of the account
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22313
diff
changeset
|
659 dialog->alias_entry = gtk_entry_new(); |
b7847aa66150
Move the Local Alias field into the User Options section of the account
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22313
diff
changeset
|
660 add_pref_box(dialog, vbox, _("_Local alias:"), dialog->alias_entry); |
b7847aa66150
Move the Local Alias field into the User Options section of the account
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22313
diff
changeset
|
661 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
662 /* New mail notifications */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
663 dialog->new_mail_check = |
17696
0d65b1438d99
Add some mnemonics to the new/modify account dialog. These are also taken
Stu Tomlinson <stu@nosnilmot.com>
parents:
17695
diff
changeset
|
664 gtk_check_button_new_with_mnemonic(_("New _mail notifications")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
665 gtk_box_pack_start(GTK_BOX(vbox), dialog->new_mail_check, FALSE, FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
666 gtk_widget_show(dialog->new_mail_check); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
667 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
668 /* Buddy icon */ |
17696
0d65b1438d99
Add some mnemonics to the new/modify account dialog. These are also taken
Stu Tomlinson <stu@nosnilmot.com>
parents:
17695
diff
changeset
|
669 dialog->icon_check = gtk_check_button_new_with_mnemonic(_("Use this buddy _icon for this account:")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
670 g_signal_connect(G_OBJECT(dialog->icon_check), "toggled", G_CALLBACK(icon_check_cb), dialog); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
671 gtk_widget_show(dialog->icon_check); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
672 gtk_box_pack_start(GTK_BOX(vbox), dialog->icon_check, FALSE, FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
673 |
15821 | 674 dialog->icon_hbox = hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
675 gtk_widget_set_sensitive(hbox, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->icon_check))); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
676 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
677 gtk_widget_show(hbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
678 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
679 label = gtk_label_new(" "); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
680 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
681 gtk_widget_show(label); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
682 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
683 button = gtk_button_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
684 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
685 gtk_widget_show(button); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
686 g_signal_connect(G_OBJECT(button), "clicked", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
687 G_CALLBACK(icon_select_cb), dialog); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
688 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
689 dialog->icon_entry = gtk_image_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
690 gtk_container_add(GTK_CONTAINER(button), dialog->icon_entry); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
691 gtk_widget_show(dialog->icon_entry); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
692 /* TODO: Uh, isn't this next line pretty useless? */ |
15507 | 693 pidgin_set_accessible_label (dialog->icon_entry, label); |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
694 purple_imgstore_unref(dialog->icon_img); |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
695 dialog->icon_img = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
696 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
697 vbox2 = gtk_vbox_new(FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
698 gtk_box_pack_start(GTK_BOX(hbox), vbox2, TRUE, TRUE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
699 gtk_widget_show(vbox2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
700 |
15821 | 701 hbox2 = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
702 gtk_box_pack_start(GTK_BOX(vbox2), hbox2, FALSE, FALSE, PIDGIN_HIG_BORDER); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
703 gtk_widget_show(hbox2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
704 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
705 button = gtk_button_new_from_stock(GTK_STOCK_REMOVE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
706 g_signal_connect(G_OBJECT(button), "clicked", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
707 G_CALLBACK(icon_reset_cb), dialog); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
708 gtk_box_pack_start(GTK_BOX(hbox2), button, FALSE, FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
709 gtk_widget_show(button); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
710 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
711 if (dialog->prpl_info != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
712 if (!(dialog->prpl_info->options & OPT_PROTO_MAIL_CHECK)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
713 gtk_widget_hide(dialog->new_mail_check); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
714 |
19610 | 715 if (dialog->prpl_info->icon_spec.format == NULL) { |
19601
979d1b4fbe35
If a prpl doesn't support icons then hide the "use a custom icon?"
Mark Doliner <mark@kingant.net>
parents:
19522
diff
changeset
|
716 gtk_widget_hide(dialog->icon_check); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
717 gtk_widget_hide(dialog->icon_hbox); |
19610 | 718 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
719 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
720 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
721 if (dialog->account != NULL) { |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
722 PurpleStoredImage *img; |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
723 gpointer data = NULL; |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
724 size_t len = 0; |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
725 |
22809
7492fdcdbcea
Fix the breakage with account aliases that I introduced when I moved the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22770
diff
changeset
|
726 if (purple_account_get_alias(dialog->account)) |
7492fdcdbcea
Fix the breakage with account aliases that I introduced when I moved the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22770
diff
changeset
|
727 gtk_entry_set_text(GTK_ENTRY(dialog->alias_entry), |
7492fdcdbcea
Fix the breakage with account aliases that I introduced when I moved the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22770
diff
changeset
|
728 purple_account_get_alias(dialog->account)); |
7492fdcdbcea
Fix the breakage with account aliases that I introduced when I moved the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22770
diff
changeset
|
729 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
730 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->new_mail_check), |
15823 | 731 purple_account_get_check_mail(dialog->account)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
732 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
733 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->icon_check), |
15823 | 734 !purple_account_get_bool(dialog->account, "use-global-buddyicon", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
735 TRUE)); |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
736 |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
737 img = purple_buddy_icons_find_account_icon(dialog->account); |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
738 if (img) |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
739 { |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
740 len = purple_imgstore_get_size(img); |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
741 data = g_memdup(purple_imgstore_get_data(img), len); |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
742 } |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
743 set_dialog_icon(dialog, data, len, |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
744 g_strdup(purple_account_get_buddy_icon_path(dialog->account))); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
745 } else { |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
746 set_dialog_icon(dialog, NULL, 0, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
747 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
748 |
22768
7eabc4ef27ed
This fixes the lack of the Local Alias field for IRC accounts since I moved
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22763
diff
changeset
|
749 #if 0 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
750 if (!dialog->prpl_info || |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
751 (!(dialog->prpl_info->options & OPT_PROTO_MAIL_CHECK) && |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
752 (dialog->prpl_info->icon_spec.format == NULL))) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
753 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
754 /* Nothing to see :( aww. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
755 gtk_widget_hide(dialog->user_frame); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
756 } |
22768
7eabc4ef27ed
This fixes the lack of the Local Alias field for IRC accounts since I moved
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22763
diff
changeset
|
757 #endif |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
758 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
759 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
760 static void |
26293
dc3258ad4462
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26279
diff
changeset
|
761 add_protocol_options(AccountPrefsDialog *dialog) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
762 { |
15823 | 763 PurpleAccountOption *option; |
764 PurpleAccount *account; | |
31460
695b6e57e255
UI hack ala Google Talk for Facebook.
Stu Tomlinson <stu@nosnilmot.com>
parents:
31075
diff
changeset
|
765 GtkWidget *vbox, *check, *entry, *combo, *menu, *item; |
18118
ab6d2763b8d8
Re-fix the DBus list handling code by killing const GList* / const GSList*
Richard Laager <rlaager@wiktel.com>
parents:
18114
diff
changeset
|
766 GList *list, *node; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
767 gint i, idx, int_value; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
768 GtkListStore *model; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
769 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
770 GtkCellRenderer *renderer; |
15823 | 771 PurpleKeyValuePair *kvp; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
772 GList *l; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
773 char buf[1024]; |
17803
d5fa6c45045e
Add mnemonics to prpl provided account options, from OpenSolaris patch
Stu Tomlinson <stu@nosnilmot.com>
parents:
17784
diff
changeset
|
774 char *title, *tmp; |
17526
8bc2b7ec45c1
Make sure if some plugin used pidgin_protocol_option_menu_new, they continue
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17262
diff
changeset
|
775 const char *str_value; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
776 gboolean bool_value; |
24980
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
777 ProtocolOptEntry *opt_entry; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
778 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
779 if (dialog->protocol_frame != NULL) { |
26293
dc3258ad4462
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26279
diff
changeset
|
780 gtk_notebook_remove_page (GTK_NOTEBOOK(dialog->notebook), 1); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
781 dialog->protocol_frame = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
782 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
783 |
24980
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
784 while (dialog->protocol_opt_entries != NULL) { |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
785 ProtocolOptEntry *opt_entry = dialog->protocol_opt_entries->data; |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
786 g_free(opt_entry->setting); |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
787 g_free(opt_entry); |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
788 dialog->protocol_opt_entries = g_list_delete_link(dialog->protocol_opt_entries, dialog->protocol_opt_entries); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
789 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
790 |
25875
dfd7be3e3cb7
Backport 96cf043274a971d5a2b9e01ef85fb60ca2a4bcd1 (#8747 - Crash when a prpl has no protocol options.)
Daniel Atallah <daniel.atallah@gmail.com>
parents:
25032
diff
changeset
|
791 if (dialog->prpl_info == NULL || |
dfd7be3e3cb7
Backport 96cf043274a971d5a2b9e01ef85fb60ca2a4bcd1 (#8747 - Crash when a prpl has no protocol options.)
Daniel Atallah <daniel.atallah@gmail.com>
parents:
25032
diff
changeset
|
792 dialog->prpl_info->protocol_options == NULL) |
dfd7be3e3cb7
Backport 96cf043274a971d5a2b9e01ef85fb60ca2a4bcd1 (#8747 - Crash when a prpl has no protocol options.)
Daniel Atallah <daniel.atallah@gmail.com>
parents:
25032
diff
changeset
|
793 return; |
dfd7be3e3cb7
Backport 96cf043274a971d5a2b9e01ef85fb60ca2a4bcd1 (#8747 - Crash when a prpl has no protocol options.)
Daniel Atallah <daniel.atallah@gmail.com>
parents:
25032
diff
changeset
|
794 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
795 account = dialog->account; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
796 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
797 /* Main vbox */ |
26293
dc3258ad4462
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26279
diff
changeset
|
798 dialog->protocol_frame = vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
dc3258ad4462
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26279
diff
changeset
|
799 gtk_container_set_border_width(GTK_CONTAINER(vbox), PIDGIN_HIG_BORDER); |
dc3258ad4462
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26279
diff
changeset
|
800 gtk_notebook_insert_page(GTK_NOTEBOOK(dialog->notebook), vbox, |
27492
beb9f969d06e
s/_Advanced/Ad_vanced/ and s/_Proxy/P_roxy/ in the tabs of the Add/Modify
Etan Reisner <pidgin@unreliablesource.net>
parents:
27429
diff
changeset
|
801 gtk_label_new_with_mnemonic(_("Ad_vanced")), 1); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
802 gtk_widget_show(vbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
803 |
31460
695b6e57e255
UI hack ala Google Talk for Facebook.
Stu Tomlinson <stu@nosnilmot.com>
parents:
31075
diff
changeset
|
804 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(dialog->protocol_menu)); |
695b6e57e255
UI hack ala Google Talk for Facebook.
Stu Tomlinson <stu@nosnilmot.com>
parents:
31075
diff
changeset
|
805 item = gtk_menu_get_active(GTK_MENU(menu)); |
695b6e57e255
UI hack ala Google Talk for Facebook.
Stu Tomlinson <stu@nosnilmot.com>
parents:
31075
diff
changeset
|
806 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
807 for (l = dialog->prpl_info->protocol_options; l != NULL; l = l->next) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
808 { |
15823 | 809 option = (PurpleAccountOption *)l->data; |
810 | |
24980
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
811 opt_entry = g_new0(ProtocolOptEntry, 1); |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
812 opt_entry->type = purple_account_option_get_type(option); |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
813 opt_entry->setting = g_strdup(purple_account_option_get_setting(option)); |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
814 |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
815 switch (opt_entry->type) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
816 { |
15823 | 817 case PURPLE_PREF_BOOLEAN: |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
818 if (account == NULL || |
15823 | 819 strcmp(purple_account_get_protocol_id(account), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
820 dialog->protocol_id)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
821 { |
15823 | 822 bool_value = purple_account_option_get_default_bool(option); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
823 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
824 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
825 { |
15823 | 826 bool_value = purple_account_get_bool(account, |
827 purple_account_option_get_setting(option), | |
828 purple_account_option_get_default_bool(option)); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
829 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
830 |
17803
d5fa6c45045e
Add mnemonics to prpl provided account options, from OpenSolaris patch
Stu Tomlinson <stu@nosnilmot.com>
parents:
17784
diff
changeset
|
831 tmp = g_strconcat("_", purple_account_option_get_text(option), NULL); |
24980
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
832 opt_entry->widget = check = gtk_check_button_new_with_mnemonic(tmp); |
17803
d5fa6c45045e
Add mnemonics to prpl provided account options, from OpenSolaris patch
Stu Tomlinson <stu@nosnilmot.com>
parents:
17784
diff
changeset
|
833 g_free(tmp); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
834 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
835 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
836 bool_value); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
837 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
838 gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
839 gtk_widget_show(check); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
840 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
841 |
15823 | 842 case PURPLE_PREF_INT: |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
843 if (account == NULL || |
15823 | 844 strcmp(purple_account_get_protocol_id(account), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
845 dialog->protocol_id)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
846 { |
15823 | 847 int_value = purple_account_option_get_default_int(option); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
848 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
849 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
850 { |
15823 | 851 int_value = purple_account_get_int(account, |
852 purple_account_option_get_setting(option), | |
853 purple_account_option_get_default_int(option)); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
854 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
855 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
856 g_snprintf(buf, sizeof(buf), "%d", int_value); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
857 |
24980
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
858 opt_entry->widget = entry = gtk_entry_new(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
859 gtk_entry_set_text(GTK_ENTRY(entry), buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
860 |
17803
d5fa6c45045e
Add mnemonics to prpl provided account options, from OpenSolaris patch
Stu Tomlinson <stu@nosnilmot.com>
parents:
17784
diff
changeset
|
861 title = g_strdup_printf("_%s:", |
15823 | 862 purple_account_option_get_text(option)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
863 add_pref_box(dialog, vbox, title, entry); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
864 g_free(title); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
865 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
866 |
15823 | 867 case PURPLE_PREF_STRING: |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
868 if (account == NULL || |
15823 | 869 strcmp(purple_account_get_protocol_id(account), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
870 dialog->protocol_id)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
871 { |
15823 | 872 str_value = purple_account_option_get_default_string(option); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
873 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
874 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
875 { |
15823 | 876 str_value = purple_account_get_string(account, |
877 purple_account_option_get_setting(option), | |
878 purple_account_option_get_default_string(option)); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
879 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
880 |
24980
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
881 opt_entry->widget = entry = gtk_entry_new(); |
15823 | 882 if (purple_account_option_get_masked(option)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
883 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
884 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); |
24987
17b840986607
GTK+ 2.16.0 will set the invisible character to a nice bullet instead of
Mark Doliner <mark@kingant.net>
parents:
24980
diff
changeset
|
885 #if !GTK_CHECK_VERSION(2,16,0) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
886 if (gtk_entry_get_invisible_char(GTK_ENTRY(entry)) == '*') |
15821 | 887 gtk_entry_set_invisible_char(GTK_ENTRY(entry), PIDGIN_INVISIBLE_CHAR); |
24987
17b840986607
GTK+ 2.16.0 will set the invisible character to a nice bullet instead of
Mark Doliner <mark@kingant.net>
parents:
24980
diff
changeset
|
888 #endif /* Less than GTK+ 2.16 */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
889 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
890 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
891 if (str_value != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
892 gtk_entry_set_text(GTK_ENTRY(entry), str_value); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
893 |
17803
d5fa6c45045e
Add mnemonics to prpl provided account options, from OpenSolaris patch
Stu Tomlinson <stu@nosnilmot.com>
parents:
17784
diff
changeset
|
894 title = g_strdup_printf("_%s:", |
15823 | 895 purple_account_option_get_text(option)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
896 add_pref_box(dialog, vbox, title, entry); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
897 g_free(title); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
898 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
899 |
15823 | 900 case PURPLE_PREF_STRING_LIST: |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
901 i = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
902 idx = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
903 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
904 if (account == NULL || |
15823 | 905 strcmp(purple_account_get_protocol_id(account), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
906 dialog->protocol_id)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
907 { |
15823 | 908 str_value = purple_account_option_get_default_list_value(option); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
909 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
910 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
911 { |
15823 | 912 str_value = purple_account_get_string(account, |
913 purple_account_option_get_setting(option), | |
914 purple_account_option_get_default_list_value(option)); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
915 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
916 |
15823 | 917 list = purple_account_option_get_list(option); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
918 model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_POINTER); |
24980
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
919 opt_entry->widget = combo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(model)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
920 |
31460
695b6e57e255
UI hack ala Google Talk for Facebook.
Stu Tomlinson <stu@nosnilmot.com>
parents:
31075
diff
changeset
|
921 if (g_object_get_data(G_OBJECT(item), "fakefacebook") && |
695b6e57e255
UI hack ala Google Talk for Facebook.
Stu Tomlinson <stu@nosnilmot.com>
parents:
31075
diff
changeset
|
922 !strcmp(opt_entry->setting, "connection_security")) |
695b6e57e255
UI hack ala Google Talk for Facebook.
Stu Tomlinson <stu@nosnilmot.com>
parents:
31075
diff
changeset
|
923 str_value = "opportunistic_tls"; |
695b6e57e255
UI hack ala Google Talk for Facebook.
Stu Tomlinson <stu@nosnilmot.com>
parents:
31075
diff
changeset
|
924 |
15823 | 925 /* Loop through list of PurpleKeyValuePair items */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
926 for (node = list; node != NULL; node = node->next) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
927 if (node->data != NULL) { |
15823 | 928 kvp = (PurpleKeyValuePair *) node->data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
929 if ((kvp->value != NULL) && (str_value != NULL) && |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
930 !g_utf8_collate(kvp->value, str_value)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
931 idx = i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
932 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
933 gtk_list_store_append(model, &iter); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
934 gtk_list_store_set(model, &iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
935 0, kvp->key, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
936 1, kvp->value, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
937 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
938 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
939 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
940 i++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
941 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
942 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
943 /* Set default */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
944 gtk_combo_box_set_active(GTK_COMBO_BOX(combo), idx); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
945 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
946 /* Define renderer */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
947 renderer = gtk_cell_renderer_text_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
948 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), renderer, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
949 TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
950 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
951 renderer, "text", 0, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
952 |
17803
d5fa6c45045e
Add mnemonics to prpl provided account options, from OpenSolaris patch
Stu Tomlinson <stu@nosnilmot.com>
parents:
17784
diff
changeset
|
953 title = g_strdup_printf("_%s:", |
15823 | 954 purple_account_option_get_text(option)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
955 add_pref_box(dialog, vbox, title, combo); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
956 g_free(title); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
957 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
958 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
959 default: |
24980
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
960 purple_debug_error("gtkaccount", "Invalid Account Option pref type (%d)\n", |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
961 opt_entry->type); |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
962 g_free(opt_entry->setting); |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
963 g_free(opt_entry); |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
964 continue; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
965 } |
24980
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
966 |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
967 dialog->protocol_opt_entries = |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
968 g_list_append(dialog->protocol_opt_entries, opt_entry); |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
969 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
970 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
971 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
972 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
973 static GtkWidget * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
974 make_proxy_dropdown(void) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
975 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
976 GtkWidget *dropdown; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
977 GtkListStore *model; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
978 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
979 GtkCellRenderer *renderer; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
980 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
981 model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
982 dropdown = gtk_combo_box_new_with_model(GTK_TREE_MODEL(model)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
983 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
984 gtk_list_store_append(model, &iter); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
985 gtk_list_store_set(model, &iter, |
15823 | 986 0, purple_running_gnome() ? _("Use GNOME Proxy Settings") |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
987 :_("Use Global Proxy Settings"), |
15823 | 988 1, PURPLE_PROXY_USE_GLOBAL, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
989 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
990 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
991 gtk_list_store_append(model, &iter); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
992 gtk_list_store_set(model, &iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
993 0, _("No Proxy"), |
15823 | 994 1, PURPLE_PROXY_NONE, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
995 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
996 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
997 gtk_list_store_append(model, &iter); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
998 gtk_list_store_set(model, &iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
999 0, _("HTTP"), |
15823 | 1000 1, PURPLE_PROXY_HTTP, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1001 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1002 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1003 gtk_list_store_append(model, &iter); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1004 gtk_list_store_set(model, &iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1005 0, _("SOCKS 4"), |
15823 | 1006 1, PURPLE_PROXY_SOCKS4, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1007 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1008 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1009 gtk_list_store_append(model, &iter); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1010 gtk_list_store_set(model, &iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1011 0, _("SOCKS 5"), |
15823 | 1012 1, PURPLE_PROXY_SOCKS5, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1013 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1014 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1015 gtk_list_store_append(model, &iter); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1016 gtk_list_store_set(model, &iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1017 0, _("Use Environmental Settings"), |
15823 | 1018 1, PURPLE_PROXY_USE_ENVVAR, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1019 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1020 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1021 renderer = gtk_cell_renderer_text_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1022 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(dropdown), renderer, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1023 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(dropdown), renderer, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1024 "text", 0, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1025 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1026 return dropdown; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1027 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1028 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1029 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1030 proxy_type_changed_cb(GtkWidget *menu, AccountPrefsDialog *dialog) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1031 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1032 dialog->new_proxy_type = |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1033 gtk_combo_box_get_active(GTK_COMBO_BOX(menu)) - 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1034 |
15823 | 1035 if (dialog->new_proxy_type == PURPLE_PROXY_USE_GLOBAL || |
1036 dialog->new_proxy_type == PURPLE_PROXY_NONE || | |
1037 dialog->new_proxy_type == PURPLE_PROXY_USE_ENVVAR) { | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1038 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1039 gtk_widget_hide_all(dialog->proxy_vbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1040 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1041 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1042 gtk_widget_show_all(dialog->proxy_vbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1043 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1044 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1045 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1046 port_popup_cb(GtkWidget *w, GtkMenu *menu, gpointer data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1047 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1048 GtkWidget *item1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1049 GtkWidget *item2; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1050 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1051 /* This is an easter egg. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1052 It means one of two things, both intended as humourus: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1053 A) your network is really slow and you have nothing better to do than |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1054 look at butterflies. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1055 B)You are looking really closely at something that shouldn't matter. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1056 item1 = gtk_menu_item_new_with_label(_("If you look real closely")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1057 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1058 /* This is an easter egg. See the comment on the previous line in the source. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1059 item2 = gtk_menu_item_new_with_label(_("you can see the butterflies mating")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1060 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1061 gtk_widget_show(item1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1062 gtk_widget_show(item2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1063 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1064 /* Prepend these in reverse order so they appear correctly. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1065 gtk_menu_shell_prepend(GTK_MENU_SHELL(menu), item2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1066 gtk_menu_shell_prepend(GTK_MENU_SHELL(menu), item1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1067 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1068 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1069 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1070 add_proxy_options(AccountPrefsDialog *dialog, GtkWidget *parent) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1071 { |
15823 | 1072 PurpleProxyInfo *proxy_info; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1073 GtkWidget *vbox; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1074 GtkWidget *vbox2; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1075 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1076 if (dialog->proxy_frame != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1077 gtk_widget_destroy(dialog->proxy_frame); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1078 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1079 /* Main vbox */ |
26293
dc3258ad4462
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26279
diff
changeset
|
1080 dialog->proxy_frame = vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
dc3258ad4462
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26279
diff
changeset
|
1081 gtk_container_add(GTK_CONTAINER(parent), vbox); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1082 gtk_widget_show(vbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1083 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1084 /* Proxy Type drop-down. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1085 dialog->proxy_dropdown = make_proxy_dropdown(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1086 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1087 add_pref_box(dialog, vbox, _("Proxy _type:"), dialog->proxy_dropdown); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1088 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1089 /* Setup the second vbox, which may be hidden at times. */ |
15821 | 1090 dialog->proxy_vbox = vbox2 = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
1091 gtk_box_pack_start(GTK_BOX(vbox), vbox2, FALSE, FALSE, PIDGIN_HIG_BORDER); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1092 gtk_widget_show(vbox2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1093 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1094 /* Host */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1095 dialog->proxy_host_entry = gtk_entry_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1096 add_pref_box(dialog, vbox2, _("_Host:"), dialog->proxy_host_entry); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1097 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1098 /* Port */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1099 dialog->proxy_port_entry = gtk_entry_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1100 add_pref_box(dialog, vbox2, _("_Port:"), dialog->proxy_port_entry); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1101 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1102 g_signal_connect(G_OBJECT(dialog->proxy_port_entry), "populate-popup", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1103 G_CALLBACK(port_popup_cb), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1104 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1105 /* User */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1106 dialog->proxy_user_entry = gtk_entry_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1107 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1108 add_pref_box(dialog, vbox2, _("_Username:"), dialog->proxy_user_entry); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1109 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1110 /* Password */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1111 dialog->proxy_pass_entry = gtk_entry_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1112 gtk_entry_set_visibility(GTK_ENTRY(dialog->proxy_pass_entry), FALSE); |
24987
17b840986607
GTK+ 2.16.0 will set the invisible character to a nice bullet instead of
Mark Doliner <mark@kingant.net>
parents:
24980
diff
changeset
|
1113 #if !GTK_CHECK_VERSION(2,16,0) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1114 if (gtk_entry_get_invisible_char(GTK_ENTRY(dialog->proxy_pass_entry)) == '*') |
15821 | 1115 gtk_entry_set_invisible_char(GTK_ENTRY(dialog->proxy_pass_entry), PIDGIN_INVISIBLE_CHAR); |
24987
17b840986607
GTK+ 2.16.0 will set the invisible character to a nice bullet instead of
Mark Doliner <mark@kingant.net>
parents:
24980
diff
changeset
|
1116 #endif /* Less than GTK+ 2.16 */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1117 add_pref_box(dialog, vbox2, _("Pa_ssword:"), dialog->proxy_pass_entry); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1118 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1119 if (dialog->account != NULL && |
15823 | 1120 (proxy_info = purple_account_get_proxy_info(dialog->account)) != NULL) { |
1121 | |
1122 PurpleProxyType type = purple_proxy_info_get_type(proxy_info); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1123 const char *value; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1124 int int_val; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1125 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1126 /* Hah! */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1127 /* I dunno what you're laughing about, fuzz ball. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1128 dialog->new_proxy_type = type; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1129 gtk_combo_box_set_active(GTK_COMBO_BOX(dialog->proxy_dropdown), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1130 type + 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1131 |
15823 | 1132 if (type == PURPLE_PROXY_USE_GLOBAL || type == PURPLE_PROXY_NONE || |
1133 type == PURPLE_PROXY_USE_ENVVAR) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1134 gtk_widget_hide_all(vbox2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1135 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1136 |
15823 | 1137 if ((value = purple_proxy_info_get_host(proxy_info)) != NULL) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1138 gtk_entry_set_text(GTK_ENTRY(dialog->proxy_host_entry), value); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1139 |
15823 | 1140 if ((int_val = purple_proxy_info_get_port(proxy_info)) != 0) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1141 char buf[11]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1142 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1143 g_snprintf(buf, sizeof(buf), "%d", int_val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1144 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1145 gtk_entry_set_text(GTK_ENTRY(dialog->proxy_port_entry), buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1146 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1147 |
15823 | 1148 if ((value = purple_proxy_info_get_username(proxy_info)) != NULL) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1149 gtk_entry_set_text(GTK_ENTRY(dialog->proxy_user_entry), value); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1150 |
15823 | 1151 if ((value = purple_proxy_info_get_password(proxy_info)) != NULL) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1152 gtk_entry_set_text(GTK_ENTRY(dialog->proxy_pass_entry), value); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1153 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1154 else { |
15823 | 1155 dialog->new_proxy_type = PURPLE_PROXY_USE_GLOBAL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1156 gtk_combo_box_set_active(GTK_COMBO_BOX(dialog->proxy_dropdown), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1157 dialog->new_proxy_type + 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1158 gtk_widget_hide_all(vbox2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1159 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1160 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1161 /* Connect signals. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1162 g_signal_connect(G_OBJECT(dialog->proxy_dropdown), "changed", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1163 G_CALLBACK(proxy_type_changed_cb), dialog); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1164 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1165 |
21913
2a591a5b3322
Make some more event handlers return appropriate gboolean values. This turns
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21906
diff
changeset
|
1166 static gboolean |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1167 account_win_destroy_cb(GtkWidget *w, GdkEvent *event, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1168 AccountPrefsDialog *dialog) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1169 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1170 g_hash_table_remove(account_pref_wins, dialog->account); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1171 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1172 gtk_widget_destroy(dialog->window); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1173 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1174 g_list_free(dialog->user_split_entries); |
24980
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
1175 while (dialog->protocol_opt_entries != NULL) { |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
1176 ProtocolOptEntry *opt_entry = dialog->protocol_opt_entries->data; |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
1177 g_free(opt_entry->setting); |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
1178 g_free(opt_entry); |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
1179 dialog->protocol_opt_entries = g_list_delete_link(dialog->protocol_opt_entries, dialog->protocol_opt_entries); |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
1180 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1181 g_free(dialog->protocol_id); |
21052
e3192d703585
Fix a leak of a GtkSizeGroup.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20336
diff
changeset
|
1182 g_object_unref(dialog->sg); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1183 |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
1184 purple_imgstore_unref(dialog->icon_img); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1185 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1186 if (dialog->icon_filesel) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1187 gtk_widget_destroy(dialog->icon_filesel); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1188 |
15823 | 1189 purple_signals_disconnect_by_handle(dialog); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1190 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1191 g_free(dialog); |
21913
2a591a5b3322
Make some more event handlers return appropriate gboolean values. This turns
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21906
diff
changeset
|
1192 return FALSE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1193 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1194 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1195 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1196 cancel_account_prefs_cb(GtkWidget *w, AccountPrefsDialog *dialog) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1197 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1198 account_win_destroy_cb(NULL, NULL, dialog); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1199 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1200 |
19505
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1201 static void |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1202 ok_account_prefs_cb(GtkWidget *w, AccountPrefsDialog *dialog) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1203 { |
15823 | 1204 PurpleProxyInfo *proxy_info = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1205 GList *l, *l2; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1206 const char *value; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1207 char *username; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1208 char *tmp; |
19505
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1209 gboolean new_acct = FALSE, icon_change = FALSE; |
15823 | 1210 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1211 |
19505
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1212 /* Build the username string. */ |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1213 username = g_strdup(gtk_entry_get_text(GTK_ENTRY(dialog->username_entry))); |
19505
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1214 |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1215 if (dialog->prpl_info != NULL) |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1216 { |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1217 for (l = dialog->prpl_info->user_splits, |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1218 l2 = dialog->user_split_entries; |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1219 l != NULL && l2 != NULL; |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1220 l = l->next, l2 = l2->next) |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1221 { |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1222 PurpleAccountUserSplit *split = l->data; |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1223 GtkEntry *entry = l2->data; |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1224 char sep[2] = " "; |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1225 |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1226 value = gtk_entry_get_text(entry); |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1227 |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1228 *sep = purple_account_user_split_get_separator(split); |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1229 |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1230 tmp = g_strconcat(username, sep, |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1231 (*value ? value : |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1232 purple_account_user_split_get_default_value(split)), |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1233 NULL); |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1234 |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1235 g_free(username); |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1236 username = tmp; |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1237 } |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1238 } |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1239 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1240 if (dialog->account == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1241 { |
19505
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1242 if (purple_accounts_find(username, dialog->protocol_id) != NULL) { |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1243 purple_debug_warning("gtkaccount", "Trying to add a duplicate %s account (%s).\n", |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1244 dialog->protocol_id, username); |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1245 |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1246 purple_notify_error(NULL, NULL, _("Unable to save new account"), |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1247 _("An account already exists with the specified criteria.")); |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1248 |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1249 g_free(username); |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1250 return; |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1251 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1252 |
18754
66df5d93cdf4
When a new user starts Pidgin we hide the buddy list so that they only
Mark Doliner <mark@kingant.net>
parents:
18575
diff
changeset
|
1253 if (purple_accounts_get_all() == NULL) { |
66df5d93cdf4
When a new user starts Pidgin we hide the buddy list so that they only
Mark Doliner <mark@kingant.net>
parents:
18575
diff
changeset
|
1254 /* We're adding our first account. Be polite and show the buddy list */ |
66df5d93cdf4
When a new user starts Pidgin we hide the buddy list so that they only
Mark Doliner <mark@kingant.net>
parents:
18575
diff
changeset
|
1255 purple_blist_set_visible(TRUE); |
66df5d93cdf4
When a new user starts Pidgin we hide the buddy list so that they only
Mark Doliner <mark@kingant.net>
parents:
18575
diff
changeset
|
1256 } |
66df5d93cdf4
When a new user starts Pidgin we hide the buddy list so that they only
Mark Doliner <mark@kingant.net>
parents:
18575
diff
changeset
|
1257 |
19505
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1258 account = purple_account_new(username, dialog->protocol_id); |
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1259 new_acct = TRUE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1260 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1261 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1262 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1263 account = dialog->account; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1264 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1265 /* Protocol */ |
15823 | 1266 purple_account_set_protocol_id(account, dialog->protocol_id); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1267 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1268 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1269 /* Alias */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1270 value = gtk_entry_get_text(GTK_ENTRY(dialog->alias_entry)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1271 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1272 if (*value != '\0') |
15823 | 1273 purple_account_set_alias(account, value); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1274 else |
15823 | 1275 purple_account_set_alias(account, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1276 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1277 /* Buddy Icon */ |
23609
33418ea6d801
Fix a crash that occurs when you try to edit an account and no prpls are available. Fixes #6355.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23236
diff
changeset
|
1278 if (dialog->prpl_info != NULL && dialog->prpl_info->icon_spec.format != NULL) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1279 { |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
1280 const char *filename; |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
1281 |
19505
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1282 if (new_acct || purple_account_get_bool(account, "use-global-buddyicon", TRUE) == |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1283 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->icon_check))) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1284 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1285 icon_change = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1286 } |
15823 | 1287 purple_account_set_bool(account, "use-global-buddyicon", !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->icon_check))); |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
1288 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1289 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->icon_check))) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1290 { |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
1291 if (dialog->icon_img) |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
1292 { |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
1293 size_t len = purple_imgstore_get_size(dialog->icon_img); |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
1294 purple_buddy_icons_set_account_icon(account, |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
1295 g_memdup(purple_imgstore_get_data(dialog->icon_img), len), |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
1296 len); |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
1297 purple_account_set_buddy_icon_path(account, purple_imgstore_get_filename(dialog->icon_img)); |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
1298 } |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
1299 else |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
1300 { |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
1301 purple_buddy_icons_set_account_icon(account, NULL, 0); |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
1302 purple_account_set_buddy_icon_path(account, NULL); |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
1303 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1304 } |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
1305 else if ((filename = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/accounts/buddyicon")) && icon_change) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1306 { |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
1307 size_t len; |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
1308 gpointer data = pidgin_convert_buddy_icon(dialog->plugin, filename, &len); |
15823 | 1309 purple_account_set_buddy_icon_path(account, filename); |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
1310 purple_buddy_icons_set_account_icon(account, data, len); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1311 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1312 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1313 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1314 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1315 /* Remember Password */ |
15823 | 1316 purple_account_set_remember_password(account, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1317 gtk_toggle_button_get_active( |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1318 GTK_TOGGLE_BUTTON(dialog->remember_pass_check))); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1319 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1320 /* Check Mail */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1321 if (dialog->prpl_info && dialog->prpl_info->options & OPT_PROTO_MAIL_CHECK) |
15823 | 1322 purple_account_set_check_mail(account, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1323 gtk_toggle_button_get_active( |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1324 GTK_TOGGLE_BUTTON(dialog->new_mail_check))); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1325 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1326 /* Password */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1327 value = gtk_entry_get_text(GTK_ENTRY(dialog->password_entry)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1328 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1329 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1330 * We set the password if this is a new account because new accounts |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1331 * will be set to online, and if the user has entered a password into |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1332 * the account editor (but has not checked the 'save' box), then we |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1333 * don't want to prompt them. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1334 */ |
19505
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1335 if ((purple_account_get_remember_password(account) || new_acct) && (*value != '\0')) |
15823 | 1336 purple_account_set_password(account, value); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1337 else |
15823 | 1338 purple_account_set_password(account, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1339 |
15823 | 1340 purple_account_set_username(account, username); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1341 g_free(username); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1342 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1343 /* Add the protocol settings */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1344 if (dialog->prpl_info) { |
24980
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
1345 ProtocolOptEntry *opt_entry; |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
1346 GtkTreeIter iter; |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
1347 char *value2; |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
1348 int int_value; |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
1349 gboolean bool_value; |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
1350 |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
1351 for (l2 = dialog->protocol_opt_entries; l2; l2 = l2->next) { |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
1352 |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
1353 opt_entry = l2->data; |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
1354 |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
1355 switch (opt_entry->type) { |
15823 | 1356 case PURPLE_PREF_STRING: |
24980
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
1357 value = gtk_entry_get_text(GTK_ENTRY(opt_entry->widget)); |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
1358 purple_account_set_string(account, opt_entry->setting, value); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1359 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1360 |
15823 | 1361 case PURPLE_PREF_INT: |
24980
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
1362 int_value = atoi(gtk_entry_get_text(GTK_ENTRY(opt_entry->widget))); |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
1363 purple_account_set_int(account, opt_entry->setting, int_value); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1364 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1365 |
15823 | 1366 case PURPLE_PREF_BOOLEAN: |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1367 bool_value = |
24980
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
1368 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(opt_entry->widget)); |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
1369 purple_account_set_bool(account, opt_entry->setting, bool_value); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1370 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1371 |
15823 | 1372 case PURPLE_PREF_STRING_LIST: |
20336
b93e7be3847b
applied changes from 9d35dde0c779cca73548172223ba557f27d61882
Luke Schierer <lschiere@pidgin.im>
parents:
20251
diff
changeset
|
1373 value2 = NULL; |
24980
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
1374 if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(opt_entry->widget), &iter)) |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
1375 gtk_tree_model_get(gtk_combo_box_get_model(GTK_COMBO_BOX(opt_entry->widget)), &iter, 1, &value2, -1); |
a69ce97a1600
When saving the account settings, use the protocol options that were present at
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24919
diff
changeset
|
1376 purple_account_set_string(account, opt_entry->setting, value2); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1377 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1378 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1379 default: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1380 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1381 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1382 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1383 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1384 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1385 /* Set the proxy stuff. */ |
15823 | 1386 proxy_info = purple_account_get_proxy_info(account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1387 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1388 /* Create the proxy info if it doesn't exist. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1389 if (proxy_info == NULL) { |
15823 | 1390 proxy_info = purple_proxy_info_new(); |
1391 purple_account_set_proxy_info(account, proxy_info); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1392 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1393 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1394 /* Set the proxy info type. */ |
15823 | 1395 purple_proxy_info_set_type(proxy_info, dialog->new_proxy_type); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1396 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1397 /* Host */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1398 value = gtk_entry_get_text(GTK_ENTRY(dialog->proxy_host_entry)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1399 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1400 if (*value != '\0') |
15823 | 1401 purple_proxy_info_set_host(proxy_info, value); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1402 else |
15823 | 1403 purple_proxy_info_set_host(proxy_info, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1404 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1405 /* Port */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1406 value = gtk_entry_get_text(GTK_ENTRY(dialog->proxy_port_entry)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1407 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1408 if (*value != '\0') |
15823 | 1409 purple_proxy_info_set_port(proxy_info, atoi(value)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1410 else |
15823 | 1411 purple_proxy_info_set_port(proxy_info, 0); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1412 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1413 /* Username */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1414 value = gtk_entry_get_text(GTK_ENTRY(dialog->proxy_user_entry)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1415 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1416 if (*value != '\0') |
15823 | 1417 purple_proxy_info_set_username(proxy_info, value); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1418 else |
15823 | 1419 purple_proxy_info_set_username(proxy_info, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1420 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1421 /* Password */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1422 value = gtk_entry_get_text(GTK_ENTRY(dialog->proxy_pass_entry)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1423 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1424 if (*value != '\0') |
15823 | 1425 purple_proxy_info_set_password(proxy_info, value); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1426 else |
15823 | 1427 purple_proxy_info_set_password(proxy_info, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1428 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1429 /* If there are no values set then proxy_info NULL */ |
15823 | 1430 if ((purple_proxy_info_get_type(proxy_info) == PURPLE_PROXY_USE_GLOBAL) && |
1431 (purple_proxy_info_get_host(proxy_info) == NULL) && | |
1432 (purple_proxy_info_get_port(proxy_info) == 0) && | |
1433 (purple_proxy_info_get_username(proxy_info) == NULL) && | |
1434 (purple_proxy_info_get_password(proxy_info) == NULL)) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1435 { |
15823 | 1436 purple_account_set_proxy_info(account, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1437 proxy_info = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1438 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1439 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1440 /* If this is a new account, add it to our list */ |
19505
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1441 if (new_acct) |
15823 | 1442 purple_accounts_add(account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1443 else |
15823 | 1444 purple_signal_emit(pidgin_account_get_handle(), "account-modified", account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1445 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1446 /* If this is a new account, then sign on! */ |
19395
8ce97365b418
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@gmail.com>
parents:
18829
diff
changeset
|
1447 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->register_button))) { |
8ce97365b418
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@gmail.com>
parents:
18829
diff
changeset
|
1448 purple_account_register(account); |
19505
f9b3ab516f22
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19395
diff
changeset
|
1449 } else if (new_acct) { |
15823 | 1450 const PurpleSavedStatus *saved_status; |
1451 | |
1452 saved_status = purple_savedstatus_get_current(); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1453 if (saved_status != NULL) { |
15823 | 1454 purple_savedstatus_activate_for_account(saved_status, account); |
1455 purple_account_set_enabled(account, PIDGIN_UI, TRUE); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1456 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1457 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1458 |
16847 | 1459 /* We no longer need the data from the dialog window */ |
1460 account_win_destroy_cb(NULL, NULL, dialog); | |
1461 | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1462 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1463 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1464 static const GtkTargetEntry dnd_targets[] = { |
15458
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
1465 {"text/plain", 0, 0}, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1466 {"text/uri-list", 0, 1}, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1467 {"STRING", 0, 2} |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1468 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1469 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1470 void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
1471 pidgin_account_dialog_show(PidginAccountDialogType type, |
15823 | 1472 PurpleAccount *account) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1473 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1474 AccountPrefsDialog *dialog; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1475 GtkWidget *win; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1476 GtkWidget *main_vbox; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1477 GtkWidget *vbox; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1478 GtkWidget *dbox; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1479 GtkWidget *notebook; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1480 GtkWidget *button; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1481 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1482 if (accounts_window != NULL && account != NULL && |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1483 (dialog = g_hash_table_lookup(account_pref_wins, account)) != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1484 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1485 gtk_window_present(GTK_WINDOW(dialog->window)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1486 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1487 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1488 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1489 dialog = g_new0(AccountPrefsDialog, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1490 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1491 if (accounts_window != NULL && account != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1492 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1493 g_hash_table_insert(account_pref_wins, account, dialog); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1494 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1495 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1496 dialog->account = account; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1497 dialog->type = type; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1498 dialog->sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1499 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1500 if (dialog->account == NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1501 /* Select the first prpl in the list*/ |
15823 | 1502 GList *prpl_list = purple_plugins_get_protocols(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1503 if (prpl_list != NULL) |
15823 | 1504 dialog->protocol_id = g_strdup(((PurplePlugin *) prpl_list->data)->info->id); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1505 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1506 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1507 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1508 dialog->protocol_id = |
15823 | 1509 g_strdup(purple_account_get_protocol_id(dialog->account)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1510 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1511 |
15823 | 1512 if ((dialog->plugin = purple_find_prpl(dialog->protocol_id)) != NULL) |
1513 dialog->prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(dialog->plugin); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1514 |
21646
2a2496044eef
Patch from fmoo. This makes a lot of the windows closeable with Escape. There
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21560
diff
changeset
|
1515 dialog->window = win = pidgin_create_dialog((type == PIDGIN_ADD_ACCOUNT_DIALOG) ? _("Add Account") : _("Modify Account"), |
26293
dc3258ad4462
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26279
diff
changeset
|
1516 PIDGIN_HIG_BOX_SPACE, "account", FALSE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1517 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1518 g_signal_connect(G_OBJECT(win), "delete_event", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1519 G_CALLBACK(account_win_destroy_cb), dialog); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1520 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1521 /* Setup the vbox */ |
26293
dc3258ad4462
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26279
diff
changeset
|
1522 main_vbox = pidgin_dialog_get_vbox_with_properties(GTK_DIALOG(win), FALSE, PIDGIN_HIG_BOX_SPACE); |
dc3258ad4462
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26279
diff
changeset
|
1523 |
dc3258ad4462
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26279
diff
changeset
|
1524 dialog->notebook = notebook = gtk_notebook_new(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1525 gtk_box_pack_start(GTK_BOX(main_vbox), notebook, FALSE, FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1526 gtk_widget_show(GTK_WIDGET(notebook)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1527 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1528 /* Setup the inner vbox */ |
15821 | 1529 dialog->top_vbox = vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER); |
1530 gtk_container_set_border_width(GTK_CONTAINER(vbox), PIDGIN_HIG_BORDER); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1531 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1532 gtk_label_new_with_mnemonic(_("_Basic"))); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1533 gtk_widget_show(vbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1534 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1535 /* Setup the top frames. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1536 add_login_options(dialog, vbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1537 add_user_options(dialog, vbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1538 |
23101
bce10d146dd4
Add a mnemonic to "Create this new account on the server".
Will Thompson <will.thompson@collabora.co.uk>
parents:
22809
diff
changeset
|
1539 button = gtk_check_button_new_with_mnemonic( |
bce10d146dd4
Add a mnemonic to "Create this new account on the server".
Will Thompson <will.thompson@collabora.co.uk>
parents:
22809
diff
changeset
|
1540 _("Create _this new account on the server")); |
19395
8ce97365b418
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@gmail.com>
parents:
18829
diff
changeset
|
1541 gtk_box_pack_start(GTK_BOX(main_vbox), button, FALSE, FALSE, 0); |
8ce97365b418
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@gmail.com>
parents:
18829
diff
changeset
|
1542 gtk_widget_show(button); |
8ce97365b418
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@gmail.com>
parents:
18829
diff
changeset
|
1543 dialog->register_button = button; |
8ce97365b418
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@gmail.com>
parents:
18829
diff
changeset
|
1544 if (dialog->account == NULL) |
8ce97365b418
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@gmail.com>
parents:
18829
diff
changeset
|
1545 gtk_widget_set_sensitive(button, FALSE); |
8ce97365b418
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@gmail.com>
parents:
18829
diff
changeset
|
1546 |
8ce97365b418
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@gmail.com>
parents:
18829
diff
changeset
|
1547 if (!dialog->prpl_info || !dialog->prpl_info->register_user) |
8ce97365b418
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@gmail.com>
parents:
18829
diff
changeset
|
1548 gtk_widget_hide(button); |
8ce97365b418
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@gmail.com>
parents:
18829
diff
changeset
|
1549 |
26293
dc3258ad4462
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26279
diff
changeset
|
1550 /* Setup the page with 'Advanced' (protocol options). */ |
dc3258ad4462
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26279
diff
changeset
|
1551 add_protocol_options(dialog); |
dc3258ad4462
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26279
diff
changeset
|
1552 |
dc3258ad4462
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26279
diff
changeset
|
1553 /* Setup the page with 'Proxy'. */ |
dc3258ad4462
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26279
diff
changeset
|
1554 dbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER); |
15821 | 1555 gtk_container_set_border_width(GTK_CONTAINER(dbox), PIDGIN_HIG_BORDER); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1556 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), dbox, |
27492
beb9f969d06e
s/_Advanced/Ad_vanced/ and s/_Proxy/P_roxy/ in the tabs of the Add/Modify
Etan Reisner <pidgin@unreliablesource.net>
parents:
27429
diff
changeset
|
1557 gtk_label_new_with_mnemonic(_("P_roxy"))); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1558 gtk_widget_show(dbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1559 add_proxy_options(dialog, dbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1560 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1561 /* Cancel button */ |
21652
eb2d5ba2a50d
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21646
diff
changeset
|
1562 pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_CANCEL, G_CALLBACK(cancel_account_prefs_cb), dialog); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1563 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1564 /* Save button */ |
24919
fe5179d40a51
Make dialogs that double as add and save dialogs indicate the current action
Etan Reisner <pidgin@unreliablesource.net>
parents:
24848
diff
changeset
|
1565 button = pidgin_dialog_add_button(GTK_DIALOG(win), |
fe5179d40a51
Make dialogs that double as add and save dialogs indicate the current action
Etan Reisner <pidgin@unreliablesource.net>
parents:
24848
diff
changeset
|
1566 (type == PIDGIN_ADD_ACCOUNT_DIALOG) ? GTK_STOCK_ADD : GTK_STOCK_SAVE, |
fe5179d40a51
Make dialogs that double as add and save dialogs indicate the current action
Etan Reisner <pidgin@unreliablesource.net>
parents:
24848
diff
changeset
|
1567 G_CALLBACK(ok_account_prefs_cb), |
fe5179d40a51
Make dialogs that double as add and save dialogs indicate the current action
Etan Reisner <pidgin@unreliablesource.net>
parents:
24848
diff
changeset
|
1568 dialog); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1569 if (dialog->account == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1570 gtk_widget_set_sensitive(button, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1571 dialog->ok_button = button; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1572 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1573 /* Set up DND */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1574 gtk_drag_dest_set(dialog->window, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1575 GTK_DEST_DEFAULT_MOTION | |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1576 GTK_DEST_DEFAULT_DROP, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1577 dnd_targets, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1578 sizeof(dnd_targets) / sizeof(GtkTargetEntry), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1579 GDK_ACTION_COPY); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1580 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1581 g_signal_connect(G_OBJECT(dialog->window), "drag_data_received", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1582 G_CALLBACK(account_dnd_recv), dialog); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1583 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1584 /* Show the window. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1585 gtk_widget_show(win); |
23112
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
1586 if (!account) |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23107
diff
changeset
|
1587 gtk_widget_grab_focus(dialog->protocol_menu); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1588 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1589 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1590 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1591 * Accounts Dialog |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1592 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1593 static void |
15823 | 1594 signed_on_off_cb(PurpleConnection *gc, gpointer user_data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1595 { |
15823 | 1596 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1597 GtkTreeModel *model; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1598 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1599 GdkPixbuf *pixbuf; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1600 size_t index; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1601 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1602 /* Don't need to do anything if the accounts window is not visible */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1603 if (accounts_window == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1604 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1605 |
15823 | 1606 account = purple_connection_get_account(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1607 model = GTK_TREE_MODEL(accounts_window->model); |
18063
926ccb104da0
disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents:
18058
diff
changeset
|
1608 index = g_list_index(purple_accounts_get_all(), account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1609 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1610 if (gtk_tree_model_iter_nth_child(model, &iter, NULL, index)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1611 { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
1612 pixbuf = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_MEDIUM); |
15823 | 1613 if ((pixbuf != NULL) && purple_account_is_disconnected(account)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1614 gdk_pixbuf_saturate_and_pixelate(pixbuf, pixbuf, 0.0, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1615 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1616 gtk_list_store_set(accounts_window->model, &iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1617 COLUMN_ICON, pixbuf, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1618 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1619 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1620 if (pixbuf != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1621 g_object_unref(G_OBJECT(pixbuf)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1622 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1623 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1624 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1625 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1626 * Get the GtkTreeIter of the specified account in the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1627 * GtkListStore |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1628 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1629 static gboolean |
15823 | 1630 accounts_window_find_account_in_treemodel(GtkTreeIter *iter, PurpleAccount *account) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1631 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1632 GtkTreeModel *model; |
15823 | 1633 PurpleAccount *cur; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1634 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1635 g_return_val_if_fail(account != NULL, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1636 g_return_val_if_fail(accounts_window != NULL, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1637 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1638 model = GTK_TREE_MODEL(accounts_window->model); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1639 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1640 if (!gtk_tree_model_get_iter_first(model, iter)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1641 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1642 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1643 gtk_tree_model_get(model, iter, COLUMN_DATA, &cur, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1644 if (cur == account) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1645 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1646 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1647 while (gtk_tree_model_iter_next(model, iter)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1648 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1649 gtk_tree_model_get(model, iter, COLUMN_DATA, &cur, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1650 if (cur == account) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1651 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1652 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1653 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1654 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1655 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1656 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1657 static void |
15823 | 1658 account_removed_cb(PurpleAccount *account, gpointer user_data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1659 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1660 AccountPrefsDialog *dialog; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1661 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1662 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1663 /* If the account was being modified, close the edit window */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1664 if ((dialog = g_hash_table_lookup(account_pref_wins, account)) != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1665 account_win_destroy_cb(NULL, NULL, dialog); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1666 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1667 if (accounts_window == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1668 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1669 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1670 /* Remove the account from the GtkListStore */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1671 if (accounts_window_find_account_in_treemodel(&iter, account)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1672 gtk_list_store_remove(accounts_window->model, &iter); |
15458
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
1673 |
15823 | 1674 if (purple_accounts_get_all() == NULL) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1675 gtk_notebook_set_current_page(GTK_NOTEBOOK(accounts_window->notebook), 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1676 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1677 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1678 static void |
15823 | 1679 account_abled_cb(PurpleAccount *account, gpointer user_data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1680 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1681 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1682 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1683 if (accounts_window == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1684 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1685 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1686 /* update the account in the GtkListStore */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1687 if (accounts_window_find_account_in_treemodel(&iter, account)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1688 gtk_list_store_set(accounts_window->model, &iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1689 COLUMN_ENABLED, GPOINTER_TO_INT(user_data), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1690 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1691 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1692 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1693 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1694 drag_data_get_cb(GtkWidget *widget, GdkDragContext *ctx, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1695 GtkSelectionData *data, guint info, guint time, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1696 AccountsWindow *dialog) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1697 { |
15823 | 1698 if (data->target == gdk_atom_intern("PURPLE_ACCOUNT", FALSE)) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1699 GtkTreeRowReference *ref; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1700 GtkTreePath *source_row; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1701 GtkTreeIter iter; |
15823 | 1702 PurpleAccount *account = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1703 GValue val; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1704 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1705 ref = g_object_get_data(G_OBJECT(ctx), "gtk-tree-view-source-row"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1706 source_row = gtk_tree_row_reference_get_path(ref); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1707 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1708 if (source_row == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1709 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1710 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1711 gtk_tree_model_get_iter(GTK_TREE_MODEL(dialog->model), &iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1712 source_row); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1713 val.g_type = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1714 gtk_tree_model_get_value(GTK_TREE_MODEL(dialog->model), &iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1715 COLUMN_DATA, &val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1716 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1717 dialog->drag_iter = iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1718 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1719 account = g_value_get_pointer(&val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1720 |
15823 | 1721 gtk_selection_data_set(data, gdk_atom_intern("PURPLE_ACCOUNT", FALSE), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1722 8, (void *)&account, sizeof(account)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1723 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1724 gtk_tree_path_free(source_row); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1725 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1726 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1727 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1728 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1729 move_account_after(GtkListStore *store, GtkTreeIter *iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1730 GtkTreeIter *position) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1731 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1732 GtkTreeIter new_iter; |
15823 | 1733 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1734 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1735 gtk_tree_model_get(GTK_TREE_MODEL(store), iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1736 COLUMN_DATA, &account, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1737 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1738 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1739 gtk_list_store_insert_after(store, &new_iter, position); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1740 |
15458
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
1741 set_account(store, &new_iter, account, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1742 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1743 gtk_list_store_remove(store, iter); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1744 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1745 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1746 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1747 move_account_before(GtkListStore *store, GtkTreeIter *iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1748 GtkTreeIter *position) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1749 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1750 GtkTreeIter new_iter; |
15823 | 1751 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1752 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1753 gtk_tree_model_get(GTK_TREE_MODEL(store), iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1754 COLUMN_DATA, &account, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1755 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1756 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1757 gtk_list_store_insert_before(store, &new_iter, position); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1758 |
15458
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
1759 set_account(store, &new_iter, account, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1760 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1761 gtk_list_store_remove(store, iter); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1762 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1763 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1764 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1765 drag_data_received_cb(GtkWidget *widget, GdkDragContext *ctx, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1766 guint x, guint y, GtkSelectionData *sd, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1767 guint info, guint t, AccountsWindow *dialog) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1768 { |
15823 | 1769 if (sd->target == gdk_atom_intern("PURPLE_ACCOUNT", FALSE) && sd->data) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1770 gint dest_index; |
15823 | 1771 PurpleAccount *a = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1772 GtkTreePath *path = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1773 GtkTreeViewDropPosition position; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1774 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1775 memcpy(&a, sd->data, sizeof(a)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1776 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1777 if (gtk_tree_view_get_dest_row_at_pos(GTK_TREE_VIEW(widget), x, y, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1778 &path, &position)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1779 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1780 GtkTreeIter iter; |
15823 | 1781 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1782 GValue val; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1783 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1784 gtk_tree_model_get_iter(GTK_TREE_MODEL(dialog->model), &iter, path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1785 val.g_type = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1786 gtk_tree_model_get_value(GTK_TREE_MODEL(dialog->model), &iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1787 COLUMN_DATA, &val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1788 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1789 account = g_value_get_pointer(&val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1790 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1791 switch (position) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1792 case GTK_TREE_VIEW_DROP_AFTER: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1793 case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1794 move_account_after(dialog->model, &dialog->drag_iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1795 &iter); |
18063
926ccb104da0
disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents:
18058
diff
changeset
|
1796 dest_index = g_list_index(purple_accounts_get_all(), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1797 account) + 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1798 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1799 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1800 case GTK_TREE_VIEW_DROP_BEFORE: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1801 case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: |
18063
926ccb104da0
disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents:
18058
diff
changeset
|
1802 dest_index = g_list_index(purple_accounts_get_all(), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1803 account); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1804 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1805 move_account_before(dialog->model, &dialog->drag_iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1806 &iter); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1807 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1808 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1809 default: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1810 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1811 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1812 |
15823 | 1813 purple_accounts_reorder(a, dest_index); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1814 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1815 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1816 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1817 |
21938
94dad52b61b4
Double clicking the column header/divider, or in the 'enabled' column shouldn't bring up the account-modify window. Fixes #3733.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21913
diff
changeset
|
1818 static gboolean |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1819 accedit_win_destroy_cb(GtkWidget *w, GdkEvent *event, AccountsWindow *dialog) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1820 { |
18575
d767cd75d088
pidgin_accounts_window_hide() should actually dispose of the window. Fixes #2193.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18436
diff
changeset
|
1821 dialog->window = NULL; |
d767cd75d088
pidgin_accounts_window_hide() should actually dispose of the window. Fixes #2193.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18436
diff
changeset
|
1822 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
1823 pidgin_accounts_window_hide(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1824 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1825 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1826 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1827 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1828 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1829 add_account_cb(GtkWidget *w, AccountsWindow *dialog) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1830 { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
1831 pidgin_account_dialog_show(PIDGIN_ADD_ACCOUNT_DIALOG, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1832 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1833 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1834 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1835 modify_account_sel(GtkTreeModel *model, GtkTreePath *path, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1836 GtkTreeIter *iter, gpointer data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1837 { |
15823 | 1838 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1839 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1840 gtk_tree_model_get(model, iter, COLUMN_DATA, &account, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1841 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1842 if (account != NULL) |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
1843 pidgin_account_dialog_show(PIDGIN_MODIFY_ACCOUNT_DIALOG, account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1844 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1845 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1846 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1847 modify_account_cb(GtkWidget *w, AccountsWindow *dialog) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1848 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1849 GtkTreeSelection *selection; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1850 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1851 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->treeview)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1852 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1853 gtk_tree_selection_selected_foreach(selection, modify_account_sel, dialog); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1854 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1855 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1856 static void |
15823 | 1857 delete_account_cb(PurpleAccount *account) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1858 { |
15823 | 1859 purple_accounts_delete(account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1860 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1861 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1862 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1863 ask_delete_account_sel(GtkTreeModel *model, GtkTreePath *path, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1864 GtkTreeIter *iter, gpointer data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1865 { |
15823 | 1866 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1867 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1868 gtk_tree_model_get(model, iter, COLUMN_DATA, &account, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1869 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1870 if (account != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1871 char *buf; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1872 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1873 buf = g_strdup_printf(_("Are you sure you want to delete %s?"), |
15823 | 1874 purple_account_get_username(account)); |
1875 | |
1876 purple_request_close_with_handle(account); | |
22257
8233bbcf3e86
The Gnome Human Interface Guidelines say, "if pressing this button by
Mark Doliner <mark@kingant.net>
parents:
22087
diff
changeset
|
1877 purple_request_action(account, NULL, buf, NULL, |
8233bbcf3e86
The Gnome Human Interface Guidelines say, "if pressing this button by
Mark Doliner <mark@kingant.net>
parents:
22087
diff
changeset
|
1878 PURPLE_DEFAULT_ACTION_NONE, |
16442
08db93bbd798
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 <evan.s@dreskin.net>
parents:
16344
diff
changeset
|
1879 account, NULL, NULL, |
08db93bbd798
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 <evan.s@dreskin.net>
parents:
16344
diff
changeset
|
1880 account, 2, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1881 _("Delete"), delete_account_cb, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1882 _("Cancel"), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1883 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1884 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1885 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1886 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1887 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1888 ask_delete_account_cb(GtkWidget *w, AccountsWindow *dialog) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1889 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1890 GtkTreeSelection *selection; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1891 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1892 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->treeview)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1893 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1894 gtk_tree_selection_selected_foreach(selection, ask_delete_account_sel, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1895 dialog); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1896 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1897 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1898 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1899 close_accounts_cb(GtkWidget *w, AccountsWindow *dialog) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1900 { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
1901 pidgin_accounts_window_hide(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1902 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1903 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1904 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1905 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1906 enabled_cb(GtkCellRendererToggle *renderer, gchar *path_str, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1907 gpointer data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1908 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1909 AccountsWindow *dialog = (AccountsWindow *)data; |
15823 | 1910 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1911 GtkTreeModel *model = GTK_TREE_MODEL(dialog->model); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1912 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1913 gboolean enabled; |
15823 | 1914 const PurpleSavedStatus *saved_status; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1915 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1916 gtk_tree_model_get_iter_from_string(model, &iter, path_str); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1917 gtk_tree_model_get(model, &iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1918 COLUMN_DATA, &account, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1919 COLUMN_ENABLED, &enabled, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1920 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1921 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1922 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1923 * If we just enabled the account, then set the statuses |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1924 * to the current status. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1925 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1926 if (!enabled) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1927 { |
15823 | 1928 saved_status = purple_savedstatus_get_current(); |
1929 purple_savedstatus_activate_for_account(saved_status, account); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1930 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1931 |
15823 | 1932 purple_account_set_enabled(account, PIDGIN_UI, !enabled); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1933 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1934 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1935 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1936 add_columns(GtkWidget *treeview, AccountsWindow *dialog) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1937 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1938 GtkCellRenderer *renderer; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1939 GtkTreeViewColumn *column; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1940 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1941 /* Enabled */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1942 renderer = gtk_cell_renderer_toggle_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1943 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1944 g_signal_connect(G_OBJECT(renderer), "toggled", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1945 G_CALLBACK(enabled_cb), dialog); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1946 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1947 column = gtk_tree_view_column_new_with_attributes(_("Enabled"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1948 renderer, "active", COLUMN_ENABLED, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1949 |
23151
da1b9eeac7b5
Change how the columns in the account-manager window are resized.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23144
diff
changeset
|
1950 gtk_tree_view_column_set_resizable(column, FALSE); |
da1b9eeac7b5
Change how the columns in the account-manager window are resized.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23144
diff
changeset
|
1951 gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1952 |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1953 /* Username column */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1954 column = gtk_tree_view_column_new(); |
22770
cc8903c59d6b
Change the string "screen name" to "username" everywhere. I think most
Mark Doliner <mark@kingant.net>
parents:
22769
diff
changeset
|
1955 gtk_tree_view_column_set_title(column, _("Username")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1956 gtk_tree_view_column_set_resizable(column, TRUE); |
23151
da1b9eeac7b5
Change how the columns in the account-manager window are resized.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23144
diff
changeset
|
1957 gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1958 |
15435
29e443e0613f
I think this takes care of protocol icons. Note there are still places
Sean Egan <seanegan@gmail.com>
parents:
15374
diff
changeset
|
1959 /* Buddy Icon */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1960 renderer = gtk_cell_renderer_pixbuf_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1961 gtk_tree_view_column_pack_start(column, renderer, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1962 gtk_tree_view_column_add_attribute(column, renderer, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1963 "pixbuf", COLUMN_BUDDYICON); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1964 |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1965 /* Username */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1966 renderer = gtk_cell_renderer_text_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1967 gtk_tree_view_column_pack_start(column, renderer, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1968 gtk_tree_view_column_add_attribute(column, renderer, |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1969 "text", COLUMN_USERNAME); |
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1970 dialog->username_col = column; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1971 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1972 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1973 /* Protocol name */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1974 column = gtk_tree_view_column_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1975 gtk_tree_view_column_set_title(column, _("Protocol")); |
23151
da1b9eeac7b5
Change how the columns in the account-manager window are resized.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23144
diff
changeset
|
1976 gtk_tree_view_column_set_resizable(column, FALSE); |
da1b9eeac7b5
Change how the columns in the account-manager window are resized.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23144
diff
changeset
|
1977 gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1978 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1979 /* Icon */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1980 renderer = gtk_cell_renderer_pixbuf_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1981 gtk_tree_view_column_pack_start(column, renderer, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1982 gtk_tree_view_column_add_attribute(column, renderer, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1983 "pixbuf", COLUMN_ICON); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1984 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1985 renderer = gtk_cell_renderer_text_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1986 gtk_tree_view_column_pack_start(column, renderer, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1987 gtk_tree_view_column_add_attribute(column, renderer, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1988 "text", COLUMN_PROTOCOL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1989 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1990 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1991 static void |
15823 | 1992 set_account(GtkListStore *store, GtkTreeIter *iter, PurpleAccount *account, GdkPixbuf *global_buddyicon) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1993 { |
15458
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
1994 GdkPixbuf *pixbuf, *buddyicon = NULL; |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
1995 PurpleStoredImage *img = NULL; |
17486
ec8a4b674d50
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 <daniel.atallah@gmail.com>
parents:
17430
diff
changeset
|
1996 PurplePlugin *prpl; |
ec8a4b674d50
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 <daniel.atallah@gmail.com>
parents:
17430
diff
changeset
|
1997 PurplePluginProtocolInfo *prpl_info = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1998 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
1999 pixbuf = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_MEDIUM); |
15823 | 2000 if ((pixbuf != NULL) && purple_account_is_disconnected(account)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2001 gdk_pixbuf_saturate_and_pixelate(pixbuf, pixbuf, 0.0, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2002 |
17486
ec8a4b674d50
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 <daniel.atallah@gmail.com>
parents:
17430
diff
changeset
|
2003 prpl = purple_find_prpl(purple_account_get_protocol_id(account)); |
ec8a4b674d50
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 <daniel.atallah@gmail.com>
parents:
17430
diff
changeset
|
2004 if (prpl != NULL) |
ec8a4b674d50
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 <daniel.atallah@gmail.com>
parents:
17430
diff
changeset
|
2005 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
ec8a4b674d50
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 <daniel.atallah@gmail.com>
parents:
17430
diff
changeset
|
2006 if (prpl_info != NULL && prpl_info->icon_spec.format != NULL) { |
ec8a4b674d50
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 <daniel.atallah@gmail.com>
parents:
17430
diff
changeset
|
2007 if (purple_account_get_bool(account, "use-global-buddyicon", TRUE)) { |
ec8a4b674d50
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 <daniel.atallah@gmail.com>
parents:
17430
diff
changeset
|
2008 if (global_buddyicon != NULL) |
ec8a4b674d50
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 <daniel.atallah@gmail.com>
parents:
17430
diff
changeset
|
2009 buddyicon = g_object_ref(G_OBJECT(global_buddyicon)); |
25032
c434094cf298
Fix a bug where the thumbnail buddy icon in the Accounts dialog would
Mark Doliner <mark@kingant.net>
parents:
24987
diff
changeset
|
2010 else { |
c434094cf298
Fix a bug where the thumbnail buddy icon in the Accounts dialog would
Mark Doliner <mark@kingant.net>
parents:
24987
diff
changeset
|
2011 /* This is for when set_account() is called for a single account */ |
c434094cf298
Fix a bug where the thumbnail buddy icon in the Accounts dialog would
Mark Doliner <mark@kingant.net>
parents:
24987
diff
changeset
|
2012 const char *path; |
c434094cf298
Fix a bug where the thumbnail buddy icon in the Accounts dialog would
Mark Doliner <mark@kingant.net>
parents:
24987
diff
changeset
|
2013 path = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/accounts/buddyicon"); |
27172
4dfffaf9ceac
Don't try to load an image from an empty path. It just spews to the debug log.
Etan Reisner <pidgin@unreliablesource.net>
parents:
26705
diff
changeset
|
2014 if ((path != NULL) && (*path != '\0')) { |
25032
c434094cf298
Fix a bug where the thumbnail buddy icon in the Accounts dialog would
Mark Doliner <mark@kingant.net>
parents:
24987
diff
changeset
|
2015 img = purple_imgstore_new_from_file(path); |
27172
4dfffaf9ceac
Don't try to load an image from an empty path. It just spews to the debug log.
Etan Reisner <pidgin@unreliablesource.net>
parents:
26705
diff
changeset
|
2016 } |
25032
c434094cf298
Fix a bug where the thumbnail buddy icon in the Accounts dialog would
Mark Doliner <mark@kingant.net>
parents:
24987
diff
changeset
|
2017 } |
17486
ec8a4b674d50
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 <daniel.atallah@gmail.com>
parents:
17430
diff
changeset
|
2018 } else { |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
2019 img = purple_buddy_icons_find_account_icon(account); |
17486
ec8a4b674d50
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 <daniel.atallah@gmail.com>
parents:
17430
diff
changeset
|
2020 } |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
2021 } |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
2022 |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
2023 if (img != NULL) { |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
2024 GdkPixbuf *buddyicon_pixbuf; |
23128
ce984959bda0
Add a utility function to create a pixbuf from a stored image.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22313
diff
changeset
|
2025 buddyicon_pixbuf = pidgin_pixbuf_from_imgstore(img); |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
2026 purple_imgstore_unref(img); |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
2027 |
15458
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
2028 if (buddyicon_pixbuf != NULL) { |
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
2029 buddyicon = gdk_pixbuf_scale_simple(buddyicon_pixbuf, 22, 22, GDK_INTERP_HYPER); |
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
2030 g_object_unref(G_OBJECT(buddyicon_pixbuf)); |
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
2031 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2032 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2033 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2034 gtk_list_store_set(store, iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2035 COLUMN_ICON, pixbuf, |
15458
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
2036 COLUMN_BUDDYICON, buddyicon, |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2037 COLUMN_USERNAME, purple_account_get_username(account), |
15823 | 2038 COLUMN_ENABLED, purple_account_get_enabled(account, PIDGIN_UI), |
2039 COLUMN_PROTOCOL, purple_account_get_protocol_name(account), | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2040 COLUMN_DATA, account, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2041 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2042 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2043 if (pixbuf != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2044 g_object_unref(G_OBJECT(pixbuf)); |
15458
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
2045 if (buddyicon != NULL) |
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
2046 g_object_unref(G_OBJECT(buddyicon)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2047 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2048 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2049 static void |
15823 | 2050 add_account_to_liststore(PurpleAccount *account, gpointer user_data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2051 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2052 GtkTreeIter iter; |
15458
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
2053 GdkPixbuf *global_buddyicon = user_data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2054 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2055 if (accounts_window == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2056 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2057 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2058 gtk_list_store_append(accounts_window->model, &iter); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2059 gtk_notebook_set_current_page(GTK_NOTEBOOK(accounts_window->notebook),1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2060 |
15458
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
2061 set_account(accounts_window->model, &iter, account, global_buddyicon); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2062 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2063 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2064 static gboolean |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2065 populate_accounts_list(AccountsWindow *dialog) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2066 { |
18063
926ccb104da0
disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents:
18058
diff
changeset
|
2067 GList *l; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2068 gboolean ret = FALSE; |
15458
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
2069 GdkPixbuf *global_buddyicon = NULL; |
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
2070 const char *path; |
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
2071 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2072 gtk_list_store_clear(dialog->model); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2073 |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
2074 if ((path = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/accounts/buddyicon")) != NULL) { |
15458
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
2075 GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(path, NULL); |
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
2076 if (pixbuf != NULL) { |
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
2077 global_buddyicon = gdk_pixbuf_scale_simple(pixbuf, 22, 22, GDK_INTERP_HYPER); |
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
2078 g_object_unref(G_OBJECT(pixbuf)); |
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
2079 } |
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
2080 } |
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
2081 |
15823 | 2082 for (l = purple_accounts_get_all(); l != NULL; l = l->next) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2083 ret = TRUE; |
15823 | 2084 add_account_to_liststore((PurpleAccount *)l->data, global_buddyicon); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2085 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2086 |
15458
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
2087 if (global_buddyicon != NULL) |
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
2088 g_object_unref(G_OBJECT(global_buddyicon)); |
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
2089 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2090 return ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2091 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2092 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2093 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2094 account_selected_cb(GtkTreeSelection *sel, AccountsWindow *dialog) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2095 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2096 gboolean selected = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2097 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2098 selected = (gtk_tree_selection_count_selected_rows(sel) > 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2099 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2100 gtk_widget_set_sensitive(dialog->modify_button, selected); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2101 gtk_widget_set_sensitive(dialog->delete_button, selected); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2102 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2103 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2104 static gboolean |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2105 account_treeview_double_click_cb(GtkTreeView *treeview, GdkEventButton *event, gpointer user_data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2106 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2107 AccountsWindow *dialog; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2108 GtkTreePath *path; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2109 GtkTreeViewColumn *column; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2110 GtkTreeIter iter; |
15823 | 2111 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2112 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2113 dialog = (AccountsWindow *)user_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2114 |
21938
94dad52b61b4
Double clicking the column header/divider, or in the 'enabled' column shouldn't bring up the account-modify window. Fixes #3733.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21913
diff
changeset
|
2115 if (event->window != gtk_tree_view_get_bin_window(treeview)) |
94dad52b61b4
Double clicking the column header/divider, or in the 'enabled' column shouldn't bring up the account-modify window. Fixes #3733.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21913
diff
changeset
|
2116 return FALSE; |
94dad52b61b4
Double clicking the column header/divider, or in the 'enabled' column shouldn't bring up the account-modify window. Fixes #3733.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21913
diff
changeset
|
2117 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2118 /* Figure out which node was clicked */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2119 if (!gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(dialog->treeview), event->x, event->y, &path, &column, NULL, NULL)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2120 return FALSE; |
22313
42724bd41274
Plug some leaks caused by GtkTreePaths not being freed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22257
diff
changeset
|
2121 if (column == gtk_tree_view_get_column(treeview, 0)) { |
42724bd41274
Plug some leaks caused by GtkTreePaths not being freed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22257
diff
changeset
|
2122 gtk_tree_path_free(path); |
21938
94dad52b61b4
Double clicking the column header/divider, or in the 'enabled' column shouldn't bring up the account-modify window. Fixes #3733.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21913
diff
changeset
|
2123 return FALSE; |
22313
42724bd41274
Plug some leaks caused by GtkTreePaths not being freed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22257
diff
changeset
|
2124 } |
21938
94dad52b61b4
Double clicking the column header/divider, or in the 'enabled' column shouldn't bring up the account-modify window. Fixes #3733.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21913
diff
changeset
|
2125 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2126 gtk_tree_model_get_iter(GTK_TREE_MODEL(dialog->model), &iter, path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2127 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2128 gtk_tree_model_get(GTK_TREE_MODEL(dialog->model), &iter, COLUMN_DATA, &account, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2129 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2130 if ((account != NULL) && (event->button == 1) && |
21938
94dad52b61b4
Double clicking the column header/divider, or in the 'enabled' column shouldn't bring up the account-modify window. Fixes #3733.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21913
diff
changeset
|
2131 (event->type == GDK_2BUTTON_PRESS)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2132 { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
2133 pidgin_account_dialog_show(PIDGIN_MODIFY_ACCOUNT_DIALOG, account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2134 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2135 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2136 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2137 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2138 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2139 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2140 static GtkWidget * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2141 create_accounts_list(AccountsWindow *dialog) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2142 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2143 GtkWidget *frame; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2144 GtkWidget *sw; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2145 GtkWidget *label; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2146 GtkWidget *treeview; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2147 GtkTreeSelection *sel; |
15823 | 2148 GtkTargetEntry gte[] = {{"PURPLE_ACCOUNT", GTK_TARGET_SAME_APP, 0}}; |
16010
eae8e127e4fb
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
15938
diff
changeset
|
2149 char *pretty, *tmp; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2150 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2151 frame = gtk_frame_new(NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2152 gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2153 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2154 accounts_window->notebook = gtk_notebook_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2155 gtk_notebook_set_show_tabs(GTK_NOTEBOOK(accounts_window->notebook), FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2156 gtk_notebook_set_show_border(GTK_NOTEBOOK(accounts_window->notebook), FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2157 gtk_container_add(GTK_CONTAINER(frame), accounts_window->notebook); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2158 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2159 /* Create a helpful first-time-use label */ |
15458
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
2160 label = gtk_label_new(NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2161 /* Translators: Please maintain the use of -> or <- to represent the menu heirarchy */ |
16010
eae8e127e4fb
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
15938
diff
changeset
|
2162 tmp = g_strdup_printf(_( |
eae8e127e4fb
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
15938
diff
changeset
|
2163 "<span size='larger' weight='bold'>Welcome to %s!</span>\n\n" |
eae8e127e4fb
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
15938
diff
changeset
|
2164 |
eae8e127e4fb
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
15938
diff
changeset
|
2165 "You have no IM accounts configured. To start connecting with %s " |
24317
b948081819a6
Add an ellipsis to the "Add" and "Modify" buttons in the accounts, pounces, and
Alex Willmer <alex@moreati.org.uk>
parents:
24300
diff
changeset
|
2166 "press the <b>Add...</b> button below and configure your first " |
16010
eae8e127e4fb
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
15938
diff
changeset
|
2167 "account. If you want %s to connect to multiple IM accounts, " |
24317
b948081819a6
Add an ellipsis to the "Add" and "Modify" buttons in the accounts, pounces, and
Alex Willmer <alex@moreati.org.uk>
parents:
24300
diff
changeset
|
2168 "press <b>Add...</b> again to configure them all.\n\n" |
15938
d04878ce947b
Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15871
diff
changeset
|
2169 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2170 "You can come back to this window to add, edit, or remove " |
23871
7cb7bc8865af
It's not "Accounts->Add/Edit" any more, it's now "Accounts->Manage Accounts".
Richard Laager <rlaager@wiktel.com>
parents:
23609
diff
changeset
|
2171 "accounts from <b>Accounts->Manage Accounts</b> in the Buddy " |
16010
eae8e127e4fb
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
15938
diff
changeset
|
2172 "List window"), PIDGIN_NAME, PIDGIN_NAME, PIDGIN_NAME); |
eae8e127e4fb
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
15938
diff
changeset
|
2173 pretty = pidgin_make_pretty_arrows(tmp); |
eae8e127e4fb
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
15938
diff
changeset
|
2174 g_free(tmp); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2175 gtk_label_set_markup(GTK_LABEL(label), pretty); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2176 g_free(pretty); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2177 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2178 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2179 gtk_widget_show(label); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2180 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2181 gtk_misc_set_alignment(GTK_MISC(label), 0.5, 0.5); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2182 gtk_notebook_append_page(GTK_NOTEBOOK(accounts_window->notebook), label, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2183 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2184 /* Create the scrolled window. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2185 sw = gtk_scrolled_window_new(0, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2186 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2187 GTK_POLICY_AUTOMATIC, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2188 GTK_POLICY_AUTOMATIC); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2189 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2190 GTK_SHADOW_NONE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2191 gtk_notebook_append_page(GTK_NOTEBOOK(accounts_window->notebook), sw, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2192 gtk_widget_show(sw); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2193 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2194 /* Create the list model. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2195 dialog->model = gtk_list_store_new(NUM_COLUMNS, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2196 GDK_TYPE_PIXBUF, /* COLUMN_ICON */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2197 GDK_TYPE_PIXBUF, /* COLUMN_BUDDYICON */ |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2198 G_TYPE_STRING, /* COLUMN_USERNAME */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2199 G_TYPE_BOOLEAN, /* COLUMN_ENABLED */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2200 G_TYPE_STRING, /* COLUMN_PROTOCOL */ |
23236
4561cb0c6e94
eperez noticed that there's an extra unused column here.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23172
diff
changeset
|
2201 G_TYPE_POINTER /* COLUMN_DATA */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2202 ); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2203 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2204 /* And now the actual treeview */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2205 treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(dialog->model)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2206 dialog->treeview = treeview; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2207 gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(treeview), TRUE); |
22087
d943df776c09
It turns out the tree-models need to be unref'ed.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22054
diff
changeset
|
2208 g_object_unref(G_OBJECT(dialog->model)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2209 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2210 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2211 gtk_tree_selection_set_mode(sel, GTK_SELECTION_MULTIPLE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2212 g_signal_connect(G_OBJECT(sel), "changed", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2213 G_CALLBACK(account_selected_cb), dialog); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2214 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2215 /* Handle double-clicking */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2216 g_signal_connect(G_OBJECT(treeview), "button_press_event", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2217 G_CALLBACK(account_treeview_double_click_cb), dialog); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2218 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2219 gtk_container_add(GTK_CONTAINER(sw), treeview); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2220 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2221 add_columns(treeview, dialog); |
23151
da1b9eeac7b5
Change how the columns in the account-manager window are resized.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23144
diff
changeset
|
2222 gtk_tree_view_columns_autosize(GTK_TREE_VIEW(treeview)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2223 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2224 if (populate_accounts_list(dialog)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2225 gtk_notebook_set_current_page(GTK_NOTEBOOK(accounts_window->notebook), 1); |
15458
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
2226 else |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2227 gtk_notebook_set_current_page(GTK_NOTEBOOK(accounts_window->notebook), 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2228 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2229 /* Setup DND. I wanna be an orc! */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2230 gtk_tree_view_enable_model_drag_source( |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2231 GTK_TREE_VIEW(treeview), GDK_BUTTON1_MASK, gte, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2232 1, GDK_ACTION_COPY); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2233 gtk_tree_view_enable_model_drag_dest( |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2234 GTK_TREE_VIEW(treeview), gte, 1, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2235 GDK_ACTION_COPY | GDK_ACTION_MOVE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2236 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2237 g_signal_connect(G_OBJECT(treeview), "drag-data-received", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2238 G_CALLBACK(drag_data_received_cb), dialog); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2239 g_signal_connect(G_OBJECT(treeview), "drag-data-get", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2240 G_CALLBACK(drag_data_get_cb), dialog); |
15458
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
2241 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2242 gtk_widget_show_all(frame); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2243 return frame; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2244 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2245 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2246 static void |
15823 | 2247 account_modified_cb(PurpleAccount *account, AccountsWindow *window) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2248 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2249 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2250 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2251 if (!accounts_window_find_account_in_treemodel(&iter, account)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2252 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2253 |
15458
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
2254 set_account(window->model, &iter, account, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2255 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2256 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2257 static void |
15823 | 2258 global_buddyicon_changed(const char *name, PurplePrefType type, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2259 gconstpointer value, gpointer window) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2260 { |
18063
926ccb104da0
disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents:
18058
diff
changeset
|
2261 GList *list; |
15823 | 2262 for (list = purple_accounts_get_all(); list; list = list->next) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2263 account_modified_cb(list->data, window); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2264 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2265 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2266 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2267 void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
2268 pidgin_accounts_window_show(void) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2269 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2270 AccountsWindow *dialog; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2271 GtkWidget *win; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2272 GtkWidget *vbox; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2273 GtkWidget *sw; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2274 GtkWidget *button; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2275 int width, height; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2276 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2277 if (accounts_window != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2278 gtk_window_present(GTK_WINDOW(accounts_window->window)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2279 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2280 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2281 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2282 accounts_window = dialog = g_new0(AccountsWindow, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2283 |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
2284 width = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/accounts/dialog/width"); |
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
2285 height = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/accounts/dialog/height"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2286 |
21646
2a2496044eef
Patch from fmoo. This makes a lot of the windows closeable with Escape. There
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21560
diff
changeset
|
2287 dialog->window = win = pidgin_create_dialog(_("Accounts"), PIDGIN_HIG_BORDER, "accounts", TRUE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2288 gtk_window_set_default_size(GTK_WINDOW(win), width, height); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2289 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2290 g_signal_connect(G_OBJECT(win), "delete_event", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2291 G_CALLBACK(accedit_win_destroy_cb), accounts_window); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2292 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2293 /* Setup the vbox */ |
21646
2a2496044eef
Patch from fmoo. This makes a lot of the windows closeable with Escape. There
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21560
diff
changeset
|
2294 vbox = pidgin_dialog_get_vbox_with_properties(GTK_DIALOG(win), FALSE, PIDGIN_HIG_BORDER); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2295 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2296 /* Setup the scrolled window that will contain the list of accounts. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2297 sw = create_accounts_list(dialog); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2298 gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2299 gtk_widget_show(sw); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2300 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2301 /* Add button */ |
24317
b948081819a6
Add an ellipsis to the "Add" and "Modify" buttons in the accounts, pounces, and
Alex Willmer <alex@moreati.org.uk>
parents:
24300
diff
changeset
|
2302 pidgin_dialog_add_button(GTK_DIALOG(win), PIDGIN_STOCK_ADD, G_CALLBACK(add_account_cb), dialog); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2303 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2304 /* Modify button */ |
21652
eb2d5ba2a50d
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21646
diff
changeset
|
2305 button = pidgin_dialog_add_button(GTK_DIALOG(win), PIDGIN_STOCK_MODIFY, G_CALLBACK(modify_account_cb), dialog); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2306 dialog->modify_button = button; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2307 gtk_widget_set_sensitive(button, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2308 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2309 /* Delete button */ |
21652
eb2d5ba2a50d
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21646
diff
changeset
|
2310 button = pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_DELETE, G_CALLBACK(ask_delete_account_cb), dialog); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2311 dialog->delete_button = button; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2312 gtk_widget_set_sensitive(button, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2313 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2314 /* Close button */ |
21652
eb2d5ba2a50d
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21646
diff
changeset
|
2315 pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_CLOSE, G_CALLBACK(close_accounts_cb), dialog); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2316 |
15823 | 2317 purple_signal_connect(pidgin_account_get_handle(), "account-modified", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2318 accounts_window, |
15823 | 2319 PURPLE_CALLBACK(account_modified_cb), accounts_window); |
2320 purple_prefs_connect_callback(accounts_window, | |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
2321 PIDGIN_PREFS_ROOT "/accounts/buddyicon", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2322 global_buddyicon_changed, accounts_window); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2323 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2324 gtk_widget_show(win); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2325 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2326 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2327 void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
2328 pidgin_accounts_window_hide(void) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2329 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2330 if (accounts_window == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2331 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2332 |
18575
d767cd75d088
pidgin_accounts_window_hide() should actually dispose of the window. Fixes #2193.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18436
diff
changeset
|
2333 if (accounts_window->window != NULL) |
d767cd75d088
pidgin_accounts_window_hide() should actually dispose of the window. Fixes #2193.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18436
diff
changeset
|
2334 gtk_widget_destroy(accounts_window->window); |
d767cd75d088
pidgin_accounts_window_hide() should actually dispose of the window. Fixes #2193.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18436
diff
changeset
|
2335 |
15823 | 2336 purple_signals_disconnect_by_handle(accounts_window); |
2337 purple_prefs_disconnect_by_handle(accounts_window); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2338 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2339 g_free(accounts_window); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2340 accounts_window = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2341 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2342 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2343 static void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
2344 free_add_user_data(PidginAccountAddUserData *data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2345 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2346 g_free(data->username); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2347 g_free(data->alias); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2348 g_free(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2349 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2350 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2351 static void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
2352 add_user_cb(PidginAccountAddUserData *data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2353 { |
15823 | 2354 PurpleConnection *gc = purple_account_get_connection(data->account); |
2355 | |
18063
926ccb104da0
disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents:
18058
diff
changeset
|
2356 if (g_list_find(purple_connections_get_all(), gc)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2357 { |
15823 | 2358 purple_blist_request_add_buddy(data->account, data->username, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2359 NULL, data->alias); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2360 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2361 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2362 free_add_user_data(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2363 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2364 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2365 static char * |
15823 | 2366 make_info(PurpleAccount *account, PurpleConnection *gc, const char *remote_user, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2367 const char *id, const char *alias, const char *msg) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2368 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2369 if (msg != NULL && *msg == '\0') |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2370 msg = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2371 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2372 return g_strdup_printf(_("%s%s%s%s has made %s his or her buddy%s%s"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2373 remote_user, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2374 (alias != NULL ? " (" : ""), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2375 (alias != NULL ? alias : ""), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2376 (alias != NULL ? ")" : ""), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2377 (id != NULL |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2378 ? id |
15823 | 2379 : (purple_connection_get_display_name(gc) != NULL |
2380 ? purple_connection_get_display_name(gc) | |
2381 : purple_account_get_username(account))), | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2382 (msg != NULL ? ": " : "."), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2383 (msg != NULL ? msg : "")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2384 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2385 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2386 static void |
15823 | 2387 pidgin_accounts_notify_added(PurpleAccount *account, const char *remote_user, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2388 const char *id, const char *alias, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2389 const char *msg) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2390 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2391 char *buffer; |
15823 | 2392 PurpleConnection *gc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2393 GtkWidget *alert; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2394 |
15823 | 2395 gc = purple_account_get_connection(account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2396 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2397 buffer = make_info(account, gc, remote_user, id, alias, msg); |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
2398 alert = pidgin_make_mini_dialog(gc, PIDGIN_STOCK_DIALOG_INFO, buffer, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2399 NULL, NULL, _("Close"), NULL, NULL); |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
2400 pidgin_blist_add_alert(alert); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2401 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2402 g_free(buffer); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2403 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2404 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2405 static void |
15823 | 2406 pidgin_accounts_request_add(PurpleAccount *account, const char *remote_user, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2407 const char *id, const char *alias, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2408 const char *msg) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2409 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2410 char *buffer; |
15823 | 2411 PurpleConnection *gc; |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
2412 PidginAccountAddUserData *data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2413 GtkWidget *alert; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2414 |
15823 | 2415 gc = purple_account_get_connection(account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2416 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
2417 data = g_new0(PidginAccountAddUserData, 1); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2418 data->account = account; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2419 data->username = g_strdup(remote_user); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2420 data->alias = g_strdup(alias); |
15458
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
2421 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2422 buffer = make_info(account, gc, remote_user, id, alias, msg); |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
2423 alert = pidgin_make_mini_dialog(gc, PIDGIN_STOCK_DIALOG_QUESTION, |
15938
d04878ce947b
Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15871
diff
changeset
|
2424 _("Add buddy to your list?"), buffer, data, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2425 _("Add"), G_CALLBACK(add_user_cb), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2426 _("Cancel"), G_CALLBACK(free_add_user_data), NULL); |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
2427 pidgin_blist_add_alert(alert); |
15458
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
2428 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2429 g_free(buffer); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2430 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2431 |
30791
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2432 struct auth_request |
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2433 { |
15823 | 2434 PurpleAccountRequestAuthorizationCb auth_cb; |
2435 PurpleAccountRequestAuthorizationCb deny_cb; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2436 void *data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2437 char *username; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2438 char *alias; |
15823 | 2439 PurpleAccount *account; |
30791
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2440 gboolean add_buddy_after_auth; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2441 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2442 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2443 static void |
30791
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2444 free_auth_request(struct auth_request *ar) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2445 { |
30791
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2446 g_free(ar->username); |
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2447 g_free(ar->alias); |
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2448 g_free(ar); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2449 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2450 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2451 static void |
30791
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2452 authorize_and_add_cb(struct auth_request *ar) |
24541
024818afb013
A patch to clean up authorization request related stuff. Fixes #7695.
Paul Aurich <paul@darkrain42.org>
parents:
24394
diff
changeset
|
2453 { |
30791
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2454 ar->auth_cb(ar->data); |
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2455 if (ar->add_buddy_after_auth) { |
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2456 purple_blist_request_add_buddy(ar->account, ar->username, NULL, ar->alias); |
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2457 } |
24541
024818afb013
A patch to clean up authorization request related stuff. Fixes #7695.
Paul Aurich <paul@darkrain42.org>
parents:
24394
diff
changeset
|
2458 } |
024818afb013
A patch to clean up authorization request related stuff. Fixes #7695.
Paul Aurich <paul@darkrain42.org>
parents:
24394
diff
changeset
|
2459 |
024818afb013
A patch to clean up authorization request related stuff. Fixes #7695.
Paul Aurich <paul@darkrain42.org>
parents:
24394
diff
changeset
|
2460 static void |
30791
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2461 deny_no_add_cb(struct auth_request *ar) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2462 { |
30791
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2463 ar->deny_cb(ar->data); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2464 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2465 |
15478
cb3800fabd76
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 <evan.s@dreskin.net>
parents:
15458
diff
changeset
|
2466 static void * |
18829
7a594763c229
Correct the types of the authorize_cb and deny_cb parameters of
Will Thompson <will.thompson@collabora.co.uk>
parents:
18754
diff
changeset
|
2467 pidgin_accounts_request_authorization(PurpleAccount *account, |
7a594763c229
Correct the types of the authorize_cb and deny_cb parameters of
Will Thompson <will.thompson@collabora.co.uk>
parents:
18754
diff
changeset
|
2468 const char *remote_user, |
7a594763c229
Correct the types of the authorize_cb and deny_cb parameters of
Will Thompson <will.thompson@collabora.co.uk>
parents:
18754
diff
changeset
|
2469 const char *id, |
7a594763c229
Correct the types of the authorize_cb and deny_cb parameters of
Will Thompson <will.thompson@collabora.co.uk>
parents:
18754
diff
changeset
|
2470 const char *alias, |
7a594763c229
Correct the types of the authorize_cb and deny_cb parameters of
Will Thompson <will.thompson@collabora.co.uk>
parents:
18754
diff
changeset
|
2471 const char *message, |
7a594763c229
Correct the types of the authorize_cb and deny_cb parameters of
Will Thompson <will.thompson@collabora.co.uk>
parents:
18754
diff
changeset
|
2472 gboolean on_list, |
7a594763c229
Correct the types of the authorize_cb and deny_cb parameters of
Will Thompson <will.thompson@collabora.co.uk>
parents:
18754
diff
changeset
|
2473 PurpleAccountRequestAuthorizationCb auth_cb, |
7a594763c229
Correct the types of the authorize_cb and deny_cb parameters of
Will Thompson <will.thompson@collabora.co.uk>
parents:
18754
diff
changeset
|
2474 PurpleAccountRequestAuthorizationCb deny_cb, |
7a594763c229
Correct the types of the authorize_cb and deny_cb parameters of
Will Thompson <will.thompson@collabora.co.uk>
parents:
18754
diff
changeset
|
2475 void *user_data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2476 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2477 char *buffer; |
15823 | 2478 PurpleConnection *gc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2479 GtkWidget *alert; |
30791
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2480 GdkPixbuf *prpl_icon; |
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2481 struct auth_request *aa; |
31075
a1964c506f29
We should always display the "Authorize buddy?" mini-dialog, even
ivan.komarov@soc.pidgin.im
parents:
30791
diff
changeset
|
2482 gboolean have_valid_alias = alias && *alias; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2483 |
15823 | 2484 gc = purple_account_get_connection(account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2485 if (message != NULL && *message == '\0') |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2486 message = NULL; |
15458
dc69d7b760ad
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15437
diff
changeset
|
2487 |
30791
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2488 buffer = g_strdup_printf(_("%s%s%s%s wants to add you (%s) to his or her buddy list%s%s"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2489 remote_user, |
31075
a1964c506f29
We should always display the "Authorize buddy?" mini-dialog, even
ivan.komarov@soc.pidgin.im
parents:
30791
diff
changeset
|
2490 (have_valid_alias ? " (" : ""), |
a1964c506f29
We should always display the "Authorize buddy?" mini-dialog, even
ivan.komarov@soc.pidgin.im
parents:
30791
diff
changeset
|
2491 (have_valid_alias ? alias : ""), |
a1964c506f29
We should always display the "Authorize buddy?" mini-dialog, even
ivan.komarov@soc.pidgin.im
parents:
30791
diff
changeset
|
2492 (have_valid_alias ? ")" : ""), |
30791
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2493 (id != NULL |
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2494 ? id |
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2495 : (purple_connection_get_display_name(gc) != NULL |
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2496 ? purple_connection_get_display_name(gc) |
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2497 : purple_account_get_username(account))), |
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2498 (message != NULL ? ": " : "."), |
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2499 (message != NULL ? message : "")); |
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2500 |
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2501 |
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2502 prpl_icon = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_SMALL); |
31534
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
31460
diff
changeset
|
2503 |
30791
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2504 aa = g_new0(struct auth_request, 1); |
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2505 aa->auth_cb = auth_cb; |
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2506 aa->deny_cb = deny_cb; |
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2507 aa->data = user_data; |
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2508 aa->username = g_strdup(remote_user); |
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2509 aa->alias = g_strdup(alias); |
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2510 aa->account = account; |
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2511 aa->add_buddy_after_auth = !on_list; |
31534
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
31460
diff
changeset
|
2512 |
30791
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2513 alert = pidgin_make_mini_dialog_with_custom_icon( |
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2514 gc, prpl_icon, |
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2515 _("Authorize buddy?"), buffer, aa, |
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2516 _("Authorize"), authorize_and_add_cb, |
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2517 _("Deny"), deny_no_add_cb, |
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2518 NULL); |
31534
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
31460
diff
changeset
|
2519 |
30791
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2520 g_signal_connect_swapped(G_OBJECT(alert), "destroy", G_CALLBACK(free_auth_request), aa); |
c62fac7ada0d
Display the protocol icon for the authorization request dialog
ivan.komarov@soc.pidgin.im
parents:
29742
diff
changeset
|
2521 g_signal_connect(G_OBJECT(alert), "destroy", G_CALLBACK(purple_account_request_close), NULL); |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
2522 pidgin_blist_add_alert(alert); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2523 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2524 g_free(buffer); |
15938
d04878ce947b
Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15871
diff
changeset
|
2525 |
22054
658785fe1992
This makes authorization requests go away when the account is disconnected. It will leak the protocol's user_data, but without an API change, there isn't much that can be done about that. References #4609
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21992
diff
changeset
|
2526 return alert; |
15478
cb3800fabd76
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 <evan.s@dreskin.net>
parents:
15458
diff
changeset
|
2527 } |
cb3800fabd76
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 <evan.s@dreskin.net>
parents:
15458
diff
changeset
|
2528 |
cb3800fabd76
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 <evan.s@dreskin.net>
parents:
15458
diff
changeset
|
2529 static void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
2530 pidgin_accounts_request_close(void *ui_handle) |
15478
cb3800fabd76
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 <evan.s@dreskin.net>
parents:
15458
diff
changeset
|
2531 { |
22054
658785fe1992
This makes authorization requests go away when the account is disconnected. It will leak the protocol's user_data, but without an API change, there isn't much that can be done about that. References #4609
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21992
diff
changeset
|
2532 gtk_widget_destroy(GTK_WIDGET(ui_handle)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2533 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2534 |
15823 | 2535 static PurpleAccountUiOps ui_ops = |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2536 { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
2537 pidgin_accounts_notify_added, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2538 NULL, |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
2539 pidgin_accounts_request_add, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
2540 pidgin_accounts_request_authorization, |
16681
fbf111436896
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16597
diff
changeset
|
2541 pidgin_accounts_request_close, |
fbf111436896
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16597
diff
changeset
|
2542 NULL, |
fbf111436896
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16597
diff
changeset
|
2543 NULL, |
fbf111436896
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16597
diff
changeset
|
2544 NULL, |
fbf111436896
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16597
diff
changeset
|
2545 NULL |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2546 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2547 |
15823 | 2548 PurpleAccountUiOps * |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
2549 pidgin_accounts_get_ui_ops(void) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2550 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2551 return &ui_ops; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2552 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2553 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2554 void * |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
2555 pidgin_account_get_handle(void) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2556 static int handle; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2557 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2558 return &handle; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2559 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2560 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2561 void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
2562 pidgin_account_init(void) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2563 { |
15718
1f7106b999d5
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@gmail.com>
parents:
15514
diff
changeset
|
2564 char *default_avatar = NULL; |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
2565 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/accounts"); |
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
2566 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/accounts/dialog"); |
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
2567 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/accounts/dialog/width", 520); |
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
2568 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/accounts/dialog/height", 321); |
15718
1f7106b999d5
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@gmail.com>
parents:
15514
diff
changeset
|
2569 default_avatar = g_build_filename(g_get_home_dir(), ".face.icon", NULL); |
1f7106b999d5
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@gmail.com>
parents:
15514
diff
changeset
|
2570 if (!g_file_test(default_avatar, G_FILE_TEST_EXISTS)) { |
1f7106b999d5
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@gmail.com>
parents:
15514
diff
changeset
|
2571 g_free(default_avatar); |
1f7106b999d5
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@gmail.com>
parents:
15514
diff
changeset
|
2572 default_avatar = g_build_filename(g_get_home_dir(), ".face", NULL); |
1f7106b999d5
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@gmail.com>
parents:
15514
diff
changeset
|
2573 if (!g_file_test(default_avatar, G_FILE_TEST_EXISTS)) { |
1f7106b999d5
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@gmail.com>
parents:
15514
diff
changeset
|
2574 g_free(default_avatar); |
1f7106b999d5
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@gmail.com>
parents:
15514
diff
changeset
|
2575 default_avatar = NULL; |
1f7106b999d5
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@gmail.com>
parents:
15514
diff
changeset
|
2576 } |
1f7106b999d5
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@gmail.com>
parents:
15514
diff
changeset
|
2577 } |
15730
86c41495fd8f
Leak fix and printf removal.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15718
diff
changeset
|
2578 |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
2579 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/accounts/buddyicon", default_avatar); |
15730
86c41495fd8f
Leak fix and printf removal.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15718
diff
changeset
|
2580 g_free(default_avatar); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2581 |
15823 | 2582 purple_signal_register(pidgin_account_get_handle(), "account-modified", |
2583 purple_marshal_VOID__POINTER, NULL, 1, | |
2584 purple_value_new(PURPLE_TYPE_SUBTYPE, | |
2585 PURPLE_SUBTYPE_ACCOUNT)); | |
2586 | |
2587 /* Setup some purple signal handlers. */ | |
2588 purple_signal_connect(purple_connections_get_handle(), "signed-on", | |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
2589 pidgin_account_get_handle(), |
15823 | 2590 PURPLE_CALLBACK(signed_on_off_cb), NULL); |
2591 purple_signal_connect(purple_connections_get_handle(), "signed-off", | |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
2592 pidgin_account_get_handle(), |
15823 | 2593 PURPLE_CALLBACK(signed_on_off_cb), NULL); |
2594 purple_signal_connect(purple_accounts_get_handle(), "account-added", | |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
2595 pidgin_account_get_handle(), |
15823 | 2596 PURPLE_CALLBACK(add_account_to_liststore), NULL); |
2597 purple_signal_connect(purple_accounts_get_handle(), "account-removed", | |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
2598 pidgin_account_get_handle(), |
15823 | 2599 PURPLE_CALLBACK(account_removed_cb), NULL); |
2600 purple_signal_connect(purple_accounts_get_handle(), "account-disabled", | |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
2601 pidgin_account_get_handle(), |
15823 | 2602 PURPLE_CALLBACK(account_abled_cb), GINT_TO_POINTER(FALSE)); |
2603 purple_signal_connect(purple_accounts_get_handle(), "account-enabled", | |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
2604 pidgin_account_get_handle(), |
15823 | 2605 PURPLE_CALLBACK(account_abled_cb), GINT_TO_POINTER(TRUE)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2606 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2607 account_pref_wins = |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2608 g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2609 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2610 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2611 void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15478
diff
changeset
|
2612 pidgin_account_uninit(void) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2613 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2614 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2615 * TODO: Need to free all the dialogs in here. Could probably create |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2616 * a callback function to use for the free-some-data-function |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2617 * parameter of g_hash_table_new_full, above. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2618 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2619 g_hash_table_destroy(account_pref_wins); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2620 |
15823 | 2621 purple_signals_disconnect_by_handle(pidgin_account_get_handle()); |
2622 purple_signals_unregister_by_instance(pidgin_account_get_handle()); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2623 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2624 |
18004
d40fd7106ebf
merge of '1c5a391126b5b506a29f0b9e34160d239cb783c6'
Sadrul Habib Chowdhury <imadil@gmail.com>
diff
changeset
|
2625 |