Tue, 23 Aug 2022 01:58:39 -0500
Port add contact notification to GTK4
Testing Done:
Compiled only; I don't have a menu to trigger the demo action.
Reviewed at https://reviews.imfreedom.org/r/1627/
|
20330
650a7af9c238
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@pidgin.im>
parents:
19859
diff
changeset
|
1 | /* pidgin |
| 5563 | 2 | * |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
3 | * Pidgin is the legal property of its developers, whose names are too numerous |
| 8046 | 4 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 5 | * source distribution. | |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
6 | * |
| 5563 | 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by | |
| 9 | * the Free Software Foundation; either version 2 of the License, or | |
| 10 | * (at your option) any later version. | |
| 11 | * | |
| 12 | * This program is distributed in the hope that it will be useful, | |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 15 | * GNU General Public License for more details. | |
| 16 | * | |
| 17 | * You should have received a copy of the GNU General Public License | |
| 18 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19773
diff
changeset
|
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 5563 | 20 | */ |
| 9308 | 21 | |
|
40439
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40350
diff
changeset
|
22 | #ifdef HAVE_CONFIG_H |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40350
diff
changeset
|
23 | # include <config.h> |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40350
diff
changeset
|
24 | #endif |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40350
diff
changeset
|
25 | |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40350
diff
changeset
|
26 | #include <glib/gi18n-lib.h> |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40350
diff
changeset
|
27 | |
|
40350
72271baf92bc
Split PurpleKeyValuePair out to it's own file and try to do some cleanup in the files that need to include it.
Gary Kramlich <grim@reaperworld.com>
parents:
40299
diff
changeset
|
28 | #include <purple.h> |
|
40756
3a58ef28ee44
Implement mitigation for GHSL-2021-045
Gary Kramlich <grim@reaperworld.com>
parents:
40741
diff
changeset
|
29 | #include "libpurple/glibcompat.h" |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
30 | |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
31 | #include "gtkaccount.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
32 | #include "gtkblist.h" |
|
9709
2e73f176cc80
[gaim-migrate @ 10570]
Mark Doliner <markdoliner@pidgin.im>
parents:
9705
diff
changeset
|
33 | #include "gtkdialogs.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
34 | #include "gtkutils.h" |
|
40496
6941fece679b
phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents:
40490
diff
changeset
|
35 | #include "pidgincore.h" |
|
40533
b1921b17b683
Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
40496
diff
changeset
|
36 | #include "pidgindialog.h" |
|
40297
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
37 | #include "pidginprotocolchooser.h" |
|
41350
2bdf14aaf7a1
Create a PidginProxyOptions widget
Gary Kramlich <grim@reaperworld.com>
parents:
41320
diff
changeset
|
38 | #include "pidginproxyoptions.h" |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
39 | |
|
41036
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
40 | enum { |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
41 | RESPONSE_ADD = 0, |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
42 | RESPONSE_CLOSE, |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
43 | }; |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
44 | |
| 5563 | 45 | typedef struct |
| 46 | { | |
| 15884 | 47 | PurpleAccount *account; |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
48 | char *username; |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
49 | char *alias; |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
50 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
51 | } PidginAccountAddUserData; |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
52 | |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
53 | typedef struct |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
54 | { |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
55 | GtkWidget *widget; |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
56 | gchar *setting; |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
57 | PurplePrefType type; |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
58 | } ProtocolOptEntry; |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
59 | |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
60 | typedef struct |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
61 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
62 | PidginAccountDialogType type; |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
63 | |
| 15884 | 64 | PurpleAccount *account; |
|
5978
e9bbb1ec8c89
[gaim-migrate @ 6425]
Christian Hammond <chipx86@chipx86.com>
parents:
5966
diff
changeset
|
65 | char *protocol_id; |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
66 | PurpleProtocol *protocol; |
| 15884 | 67 | |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
68 | GList *user_split_entries; |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
69 | GList *protocol_opt_entries; |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
70 | |
|
5688
c185c90d9811
[gaim-migrate @ 6109]
Christian Hammond <chipx86@chipx86.com>
parents:
5687
diff
changeset
|
71 | GtkSizeGroup *sg; |
|
5651
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
72 | GtkWidget *window; |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
73 | |
|
26543
2ff0a924a18e
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26475
diff
changeset
|
74 | GtkWidget *notebook; |
|
5688
c185c90d9811
[gaim-migrate @ 6109]
Christian Hammond <chipx86@chipx86.com>
parents:
5687
diff
changeset
|
75 | GtkWidget *top_vbox; |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
76 | GtkWidget *ok_button; |
| 6141 | 77 | GtkWidget *register_button; |
|
5688
c185c90d9811
[gaim-migrate @ 6109]
Christian Hammond <chipx86@chipx86.com>
parents:
5687
diff
changeset
|
78 | |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
79 | /* Login Options */ |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
80 | GtkWidget *login_frame; |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
81 | GtkWidget *protocol_menu; |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
82 | GtkWidget *username_entry; |
|
33704
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
83 | GdkRGBA username_entry_hint_color; |
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
84 | GtkWidget *alias_entry; |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
85 | |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
86 | /* User Options */ |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
87 | GtkWidget *user_frame; |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
88 | GtkWidget *icon_hbox; |
| 14195 | 89 | GtkWidget *icon_check; |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
90 | GtkWidget *icon_entry; |
|
39930
411f3df51bcd
Convert to GtkFileChooserNative.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
91 | GtkFileChooserNative *icon_filesel; |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
92 | GtkWidget *icon_preview; |
|
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
93 | GtkWidget *icon_text; |
|
35818
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
94 | PurpleImage *icon_img; |
|
6751
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
95 | |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
96 | /* Protocol Options */ |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
97 | GtkWidget *protocol_frame; |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
98 | |
|
41350
2bdf14aaf7a1
Create a PidginProxyOptions widget
Gary Kramlich <grim@reaperworld.com>
parents:
41320
diff
changeset
|
99 | GtkWidget *proxy_options; |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5664
diff
changeset
|
100 | |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
101 | /* Voice & Video Options*/ |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
102 | GtkWidget *voice_frame; |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
103 | GtkWidget *suppression_check; |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
104 | |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
105 | } AccountPrefsDialog; |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
106 | |
|
40680
f9ea6d5e8992
Use PurpleCredentialManager instead of the old keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
107 | typedef struct { |
|
f9ea6d5e8992
Use PurpleCredentialManager instead of the old keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
108 | PurpleAccount *account; |
|
f9ea6d5e8992
Use PurpleCredentialManager instead of the old keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
109 | PidginAccountDialogType type; |
|
f9ea6d5e8992
Use PurpleCredentialManager instead of the old keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
110 | } PidginAccountDialogShowData; |
|
f9ea6d5e8992
Use PurpleCredentialManager instead of the old keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
111 | |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
112 | /************************************************************************** |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
113 | * Add/Modify Account dialog |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
114 | **************************************************************************/ |
| 5774 | 115 | static void add_login_options(AccountPrefsDialog *dialog, GtkWidget *parent); |
| 116 | static void add_user_options(AccountPrefsDialog *dialog, GtkWidget *parent); | |
|
37038
8832d14d7d0c
Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents:
36928
diff
changeset
|
117 | static void add_account_options(AccountPrefsDialog *dialog); |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
118 | static void add_voice_options(AccountPrefsDialog *dialog); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
119 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
120 | static GtkWidget * |
| 5774 | 121 | add_pref_box(AccountPrefsDialog *dialog, GtkWidget *parent, |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
122 | const char *text, GtkWidget *widget) |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
123 | { |
|
22131
12b395dc8c59
Remove a lot of duplication from a lot of places. Closes #4558.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22056
diff
changeset
|
124 | return pidgin_add_widget_to_vbox(GTK_BOX(parent), text, dialog->sg, widget, TRUE, NULL); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
125 | } |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
126 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
127 | static void |
|
16658
d5b9b112b758
Part of the patch in ticket #383:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16545
diff
changeset
|
128 | set_dialog_icon(AccountPrefsDialog *dialog, gpointer data, size_t len, gchar *new_icon_path) |
|
11286
148a24541acd
[gaim-migrate @ 13483]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
129 | { |
|
14248
caf7bdfc3e0f
[gaim-migrate @ 16849]
Daniel Atallah <datallah@pidgin.im>
parents:
14235
diff
changeset
|
130 | GdkPixbuf *pixbuf = NULL; |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
131 | PurpleBuddyIconSpec *icon_spec = NULL; |
|
14671
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
132 | |
|
35818
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
133 | if (dialog->icon_img) { |
|
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
134 | g_object_unref(dialog->icon_img); |
|
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
135 | dialog->icon_img = NULL; |
|
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
136 | } |
|
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
137 | |
|
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
138 | if (new_icon_path != NULL) { |
|
38285
72824d3b7190
Update pidgin for the PurpleImage and PurpleSmiley changes
Gary Kramlich <grim@reaperworld.com>
parents:
38277
diff
changeset
|
139 | dialog->icon_img = purple_image_new_from_file(new_icon_path, NULL); |
|
35818
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
140 | purple_debug_warning("gtkaccount", "data was not necessary"); |
|
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
141 | g_free(data); |
|
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
142 | } else if (data != NULL) { |
|
16539
75a20ae3a527
Change the imgstore and by extension, then the buddy icon code to take over
Richard Laager <rlaager@pidgin.im>
parents:
16538
diff
changeset
|
143 | if (len > 0) |
|
39463
d47e230b9d75
Fix leaky calls to purple_image_new_from_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39333
diff
changeset
|
144 | dialog->icon_img = purple_image_new_take_data(data, len); |
|
16539
75a20ae3a527
Change the imgstore and by extension, then the buddy icon code to take over
Richard Laager <rlaager@pidgin.im>
parents:
16538
diff
changeset
|
145 | else |
|
75a20ae3a527
Change the imgstore and by extension, then the buddy icon code to take over
Richard Laager <rlaager@pidgin.im>
parents:
16538
diff
changeset
|
146 | g_free(data); |
|
16544
945caa0d6436
Kill some compiler warnings and TODOs of mine.
Richard Laager <rlaager@pidgin.im>
parents:
16539
diff
changeset
|
147 | } |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
148 | |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
149 | if (dialog->icon_img != NULL) { |
|
41319
04d027ed3d63
Add gdk-pixbuf as a libpurple dependency and move helpers from pidgin to purple
Gary Kramlich <grim@reaperworld.com>
parents:
41318
diff
changeset
|
150 | pixbuf = purple_gdk_pixbuf_from_image(dialog->icon_img); |
|
14671
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
151 | } |
|
13222
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
152 | |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
153 | if (dialog->protocol) |
|
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
154 | icon_spec = purple_protocol_get_icon_spec(dialog->protocol); |
|
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
155 | |
|
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
156 | if (pixbuf && icon_spec && (icon_spec->scale_rules & PURPLE_ICON_SCALE_DISPLAY)) |
|
13222
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
157 | { |
|
14671
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
158 | /* Scale the icon to something reasonable */ |
|
13222
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
159 | int width, height; |
|
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
160 | GdkPixbuf *scale; |
|
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
161 | |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
162 | pidgin_buddy_icon_get_scale_size(pixbuf, icon_spec, |
| 15884 | 163 | PURPLE_ICON_SCALE_DISPLAY, &width, &height); |
|
13222
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
164 | scale = gdk_pixbuf_scale_simple(pixbuf, width, height, GDK_INTERP_BILINEAR); |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14087
diff
changeset
|
165 | |
|
13222
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
166 | g_object_unref(G_OBJECT(pixbuf)); |
|
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
167 | pixbuf = scale; |
|
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
168 | } |
|
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
169 | |
|
40813
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
170 | purple_buddy_icon_spec_free(icon_spec); |
|
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
171 | |
|
14671
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
172 | if (pixbuf == NULL) |
|
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
173 | { |
|
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
174 | /* Show a placeholder icon */ |
|
39053
58a0a87c7038
gtkaccount: Port avatar selector default image to GtkIconTheme
Mike Ruprecht <cmaiku@gmail.com>
parents:
39052
diff
changeset
|
175 | gtk_image_set_from_icon_name(GTK_IMAGE(dialog->icon_entry), |
|
41565
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
176 | "select-avatar"); |
|
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
177 | gtk_image_set_icon_size(GTK_IMAGE(dialog->icon_entry), |
|
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
178 | GTK_ICON_SIZE_LARGE); |
|
39053
58a0a87c7038
gtkaccount: Port avatar selector default image to GtkIconTheme
Mike Ruprecht <cmaiku@gmail.com>
parents:
39052
diff
changeset
|
179 | } else { |
|
58a0a87c7038
gtkaccount: Port avatar selector default image to GtkIconTheme
Mike Ruprecht <cmaiku@gmail.com>
parents:
39052
diff
changeset
|
180 | gtk_image_set_from_pixbuf(GTK_IMAGE(dialog->icon_entry), pixbuf); |
|
58a0a87c7038
gtkaccount: Port avatar selector default image to GtkIconTheme
Mike Ruprecht <cmaiku@gmail.com>
parents:
39052
diff
changeset
|
181 | g_object_unref(G_OBJECT(pixbuf)); |
|
14671
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
182 | } |
|
11286
148a24541acd
[gaim-migrate @ 13483]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
183 | } |
|
148a24541acd
[gaim-migrate @ 13483]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
184 | |
|
148a24541acd
[gaim-migrate @ 13483]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
185 | static void |
|
40299
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
186 | set_account_protocol_cb(GtkWidget *widget, AccountPrefsDialog *dialog) { |
|
40297
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
187 | PidginProtocolChooser *chooser = PIDGIN_PROTOCOL_CHOOSER(widget); |
|
40299
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
188 | PurpleProtocol *protocol = pidgin_protocol_chooser_get_selected(chooser); |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
189 | |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
190 | if(g_set_object(&dialog->protocol, protocol)) { |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
191 | g_clear_pointer(&dialog->protocol_id, g_free); |
|
5955
4f964635c095
[gaim-migrate @ 6399]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
192 | } |
|
40299
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
193 | g_object_unref(G_OBJECT(protocol)); |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
194 | |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
195 | if(PURPLE_IS_PROTOCOL(dialog->protocol)) { |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
196 | dialog->protocol_id = g_strdup(purple_protocol_get_id(dialog->protocol)); |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
197 | } |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
198 | |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
199 | if (dialog->account != NULL) { |
| 15884 | 200 | purple_account_clear_settings(dialog->account); |
|
40299
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
201 | } |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
202 | |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
203 | add_login_options(dialog, dialog->top_vbox); |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
204 | add_user_options(dialog, dialog->top_vbox); |
|
37038
8832d14d7d0c
Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents:
36928
diff
changeset
|
205 | add_account_options(dialog); |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
206 | add_voice_options(dialog); |
| 6141 | 207 | |
|
20092
814ecfc91244
applied changes from bb3c9dec65d16afdcc4bcedd5fd184b7207cc624
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
208 | gtk_widget_grab_focus(dialog->protocol_menu); |
|
814ecfc91244
applied changes from bb3c9dec65d16afdcc4bcedd5fd184b7207cc624
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
209 | |
|
40299
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
210 | if (!dialog->protocol || |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
211 | !PURPLE_PROTOCOL_IMPLEMENTS(dialog->protocol, SERVER, register_user)) |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
212 | { |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
213 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->register_button), FALSE); |
| 6141 | 214 | gtk_widget_hide(dialog->register_button); |
| 11358 | 215 | } else { |
|
39913
ce96d4639dc7
Remove redundant conditions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
216 | if (purple_protocol_get_options(dialog->protocol) & |
|
ce96d4639dc7
Remove redundant conditions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
217 | OPT_PROTO_REGISTER_NOSCREENNAME) { |
| 11358 | 218 | gtk_widget_set_sensitive(dialog->register_button, TRUE); |
| 219 | } else { | |
|
33055
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
220 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
221 | dialog->register_button), FALSE); |
| 11358 | 222 | gtk_widget_set_sensitive(dialog->register_button, FALSE); |
| 223 | } | |
| 6141 | 224 | gtk_widget_show(dialog->register_button); |
| 11358 | 225 | } |
|
5688
c185c90d9811
[gaim-migrate @ 6109]
Christian Hammond <chipx86@chipx86.com>
parents:
5687
diff
changeset
|
226 | } |
|
c185c90d9811
[gaim-migrate @ 6109]
Christian Hammond <chipx86@chipx86.com>
parents:
5687
diff
changeset
|
227 | |
|
c185c90d9811
[gaim-migrate @ 6109]
Christian Hammond <chipx86@chipx86.com>
parents:
5687
diff
changeset
|
228 | static void |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
229 | username_changed_cb(GtkEntry *entry, AccountPrefsDialog *dialog) |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
230 | { |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
231 | gboolean opt_noscreenname = (dialog->protocol != NULL && |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
232 | (purple_protocol_get_options(dialog->protocol) & OPT_PROTO_REGISTER_NOSCREENNAME)); |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
233 | gboolean username_valid = purple_validate(dialog->protocol, |
|
41531
2b86501d13fe
Replace gtk_entry_[gs]et_text with gtk_editable_[gs]et_text
Gary Kramlich <grim@reaperworld.com>
parents:
41526
diff
changeset
|
234 | gtk_editable_get_text(GTK_EDITABLE(entry))); |
|
33705
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
235 | |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
236 | if (dialog->ok_button) { |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
237 | if (opt_noscreenname && dialog->register_button && |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
238 | gtk_toggle_button_get_active( |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
239 | GTK_TOGGLE_BUTTON(dialog->register_button))) |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
240 | gtk_widget_set_sensitive(dialog->ok_button, TRUE); |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
241 | else |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
242 | gtk_widget_set_sensitive(dialog->ok_button, |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
243 | username_valid); |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
244 | } |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
245 | |
| 11358 | 246 | if (dialog->register_button) { |
|
33705
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
247 | if (opt_noscreenname) |
| 11358 | 248 | gtk_widget_set_sensitive(dialog->register_button, TRUE); |
| 249 | else | |
| 250 | gtk_widget_set_sensitive(dialog->register_button, | |
|
33705
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
251 | username_valid); |
| 11358 | 252 | } |
| 5826 | 253 | } |
| 6732 | 254 | |
|
33705
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
255 | static void |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
256 | register_button_cb(GtkWidget *checkbox, AccountPrefsDialog *dialog) |
|
23277
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
257 | { |
|
33705
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
258 | int register_checked = gtk_toggle_button_get_active( |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
259 | GTK_TOGGLE_BUTTON(dialog->register_button)); |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
260 | int opt_noscreenname = (dialog->protocol != NULL && |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
261 | (purple_protocol_get_options(dialog->protocol) & OPT_PROTO_REGISTER_NOSCREENNAME)); |
|
33705
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
262 | int register_noscreenname = (opt_noscreenname && register_checked); |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
263 | |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
264 | if (register_noscreenname) { |
|
41531
2b86501d13fe
Replace gtk_entry_[gs]et_text with gtk_editable_[gs]et_text
Gary Kramlich <grim@reaperworld.com>
parents:
41526
diff
changeset
|
265 | gtk_editable_set_text(GTK_EDITABLE(dialog->username_entry), ""); |
|
23277
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
266 | } |
|
33705
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
267 | gtk_widget_set_sensitive(dialog->username_entry, !register_noscreenname); |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
268 | |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
269 | if (dialog->ok_button) { |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
270 | gtk_widget_set_sensitive(dialog->ok_button, |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
271 | (opt_noscreenname && register_checked) || |
|
41531
2b86501d13fe
Replace gtk_entry_[gs]et_text with gtk_editable_[gs]et_text
Gary Kramlich <grim@reaperworld.com>
parents:
41526
diff
changeset
|
272 | *gtk_editable_get_text(GTK_EDITABLE(dialog->username_entry)) |
|
33705
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
273 | != '\0'); |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
274 | } |
|
23277
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
275 | } |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
276 | |
|
6751
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
277 | static void |
|
41502
d00bcebf0f90
Inline pidgin_buddy_icon_chooser_new
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41490
diff
changeset
|
278 | icon_filesel_choose_cb(GtkWidget *widget, gint response, gpointer data) |
| 5826 | 279 | { |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
280 | AccountPrefsDialog *dialog = data; |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
281 | |
|
41502
d00bcebf0f90
Inline pidgin_buddy_icon_chooser_new
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41490
diff
changeset
|
282 | if (response == GTK_RESPONSE_ACCEPT) { |
|
41565
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
283 | GFile *file = NULL; |
|
41502
d00bcebf0f90
Inline pidgin_buddy_icon_chooser_new
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41490
diff
changeset
|
284 | gchar *filename = NULL; |
|
d00bcebf0f90
Inline pidgin_buddy_icon_chooser_new
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41490
diff
changeset
|
285 | gpointer data = NULL; |
|
34988
81d8c99ac9b3
Initialize len = 0 before pidgin_convert_buddy_icon()
Ankit Vani <a@nevitus.org>
parents:
34955
diff
changeset
|
286 | size_t len = 0; |
|
41502
d00bcebf0f90
Inline pidgin_buddy_icon_chooser_new
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41490
diff
changeset
|
287 | |
|
41565
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
288 | file = gtk_file_chooser_get_file(GTK_FILE_CHOOSER(widget)); |
|
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
289 | filename = g_file_get_path(file); |
|
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
290 | |
|
41502
d00bcebf0f90
Inline pidgin_buddy_icon_chooser_new
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41490
diff
changeset
|
291 | data = pidgin_convert_buddy_icon(dialog->protocol, filename, &len); |
|
d00bcebf0f90
Inline pidgin_buddy_icon_chooser_new
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41490
diff
changeset
|
292 | set_dialog_icon(dialog, data, len, filename); |
|
41565
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
293 | |
|
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
294 | g_free(filename); |
|
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
295 | g_object_unref(file); |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
296 | } |
|
14203
f3a50c328ddc
[gaim-migrate @ 16783]
Mark Doliner <markdoliner@pidgin.im>
parents:
14195
diff
changeset
|
297 | |
|
39930
411f3df51bcd
Convert to GtkFileChooserNative.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
298 | g_clear_object(&dialog->icon_filesel); |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
299 | } |
|
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
300 | |
|
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
301 | static void |
|
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
302 | icon_select_cb(GtkWidget *button, AccountPrefsDialog *dialog) |
|
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
303 | { |
|
41502
d00bcebf0f90
Inline pidgin_buddy_icon_chooser_new
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41490
diff
changeset
|
304 | dialog->icon_filesel = gtk_file_chooser_native_new(_("Buddy Icon"), |
|
d00bcebf0f90
Inline pidgin_buddy_icon_chooser_new
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41490
diff
changeset
|
305 | GTK_WINDOW(dialog->window), |
|
d00bcebf0f90
Inline pidgin_buddy_icon_chooser_new
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41490
diff
changeset
|
306 | GTK_FILE_CHOOSER_ACTION_OPEN, |
|
d00bcebf0f90
Inline pidgin_buddy_icon_chooser_new
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41490
diff
changeset
|
307 | _("_Open"), |
|
d00bcebf0f90
Inline pidgin_buddy_icon_chooser_new
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41490
diff
changeset
|
308 | _("_Cancel")); |
|
d00bcebf0f90
Inline pidgin_buddy_icon_chooser_new
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41490
diff
changeset
|
309 | |
|
d00bcebf0f90
Inline pidgin_buddy_icon_chooser_new
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41490
diff
changeset
|
310 | g_signal_connect(G_OBJECT(dialog->icon_filesel), "response", |
|
d00bcebf0f90
Inline pidgin_buddy_icon_chooser_new
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41490
diff
changeset
|
311 | G_CALLBACK(icon_filesel_choose_cb), dialog); |
|
d00bcebf0f90
Inline pidgin_buddy_icon_chooser_new
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41490
diff
changeset
|
312 | |
|
39930
411f3df51bcd
Convert to GtkFileChooserNative.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
313 | gtk_native_dialog_show(GTK_NATIVE_DIALOG(dialog->icon_filesel)); |
| 5826 | 314 | } |
| 315 | ||
|
6751
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
316 | static void |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
317 | icon_reset_cb(GtkWidget *button, AccountPrefsDialog *dialog) |
| 5826 | 318 | { |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
319 | set_dialog_icon(dialog, NULL, 0, NULL); |
| 9308 | 320 | } |
| 321 | ||
| 9314 | 322 | static void |
| 15884 | 323 | update_editable(PurpleConnection *gc, AccountPrefsDialog *dialog) |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
324 | { |
|
35510
0e6c78789caa
Fix some GtkStyle deprecations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35475
diff
changeset
|
325 | GtkStyleContext *style; |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
326 | gboolean set; |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
327 | GList *l; |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
328 | |
|
12843
323bd864a6f1
[gaim-migrate @ 15191]
Richard Laager <rlaager@pidgin.im>
parents:
12671
diff
changeset
|
329 | if (dialog->account == NULL) |
|
323bd864a6f1
[gaim-migrate @ 15191]
Richard Laager <rlaager@pidgin.im>
parents:
12671
diff
changeset
|
330 | return; |
|
323bd864a6f1
[gaim-migrate @ 15191]
Richard Laager <rlaager@pidgin.im>
parents:
12671
diff
changeset
|
331 | |
| 15884 | 332 | if (gc != NULL && dialog->account != purple_connection_get_account(gc)) |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
333 | return; |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
334 | |
| 15884 | 335 | set = !(purple_account_is_connected(dialog->account) || purple_account_is_connecting(dialog->account)); |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
336 | gtk_widget_set_sensitive(dialog->protocol_menu, set); |
|
29226
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
337 | gtk_editable_set_editable(GTK_EDITABLE(dialog->username_entry), set); |
|
39054
1b17478d1d4f
gtkaccount: Fix accidental double-space
Mike Ruprecht <cmaiku@gmail.com>
parents:
39053
diff
changeset
|
338 | style = gtk_widget_get_style_context(dialog->username_entry); |
|
39050
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
339 | |
|
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
340 | if (set) { |
|
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
341 | gtk_style_context_remove_class(style, "copyable-insensitive"); |
|
35510
0e6c78789caa
Fix some GtkStyle deprecations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35475
diff
changeset
|
342 | } else { |
|
39050
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
343 | gtk_style_context_add_class(style, "copyable-insensitive"); |
|
35510
0e6c78789caa
Fix some GtkStyle deprecations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35475
diff
changeset
|
344 | } |
|
29226
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
345 | |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
346 | for (l = dialog->user_split_entries ; l != NULL ; l = l->next) { |
|
36020
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36019
diff
changeset
|
347 | if (l->data == NULL) |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36019
diff
changeset
|
348 | continue; |
|
29226
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
349 | if (GTK_IS_EDITABLE(l->data)) { |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
350 | gtk_editable_set_editable(GTK_EDITABLE(l->data), set); |
|
39050
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
351 | style = gtk_widget_get_style_context(GTK_WIDGET(l->data)); |
|
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
352 | if (set) { |
|
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
353 | gtk_style_context_remove_class(style, |
|
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
354 | "copyable-insensitive"); |
|
35510
0e6c78789caa
Fix some GtkStyle deprecations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35475
diff
changeset
|
355 | } else { |
|
39050
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
356 | gtk_style_context_add_class(style, |
|
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
357 | "copyable-insensitive"); |
|
35510
0e6c78789caa
Fix some GtkStyle deprecations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35475
diff
changeset
|
358 | } |
|
29226
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
359 | } else { |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
360 | gtk_widget_set_sensitive(GTK_WIDGET(l->data), set); |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
361 | } |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
362 | } |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
363 | } |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
364 | |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
365 | static void |
| 5774 | 366 | add_login_options(AccountPrefsDialog *dialog, GtkWidget *parent) |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
367 | { |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
368 | GtkWidget *frame; |
|
17035
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
369 | GtkWidget *hbox; |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
370 | GtkWidget *vbox; |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
371 | GtkWidget *entry; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
372 | GList *user_splits; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
373 | GList *l, *l2; |
|
5656
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
374 | char *username = NULL; |
|
39050
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
375 | GtkCssProvider *entry_css; |
|
41030
ec8b76f3bf0a
Fix the resource path so we can use the automatic stuff that GtkApplication supports
Gary Kramlich <grim@reaperworld.com>
parents:
41012
diff
changeset
|
376 | const gchar *res = "/im/pidgin/Pidgin3/Accounts/entry.css"; |
|
39050
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
377 | |
|
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
378 | entry_css = gtk_css_provider_new(); |
|
40552
eb0f386cea6b
Moved all of the inline css in pidgin to resource files
Gary Kramlich <grim@reaperworld.com>
parents:
40533
diff
changeset
|
379 | gtk_css_provider_load_from_resource(entry_css, res); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
380 | |
|
17035
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
381 | if (dialog->protocol_menu != NULL) |
|
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
382 | { |
|
26820
76f90ca8f6f2
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26543
diff
changeset
|
383 | g_object_ref(G_OBJECT(dialog->protocol_menu)); |
|
17035
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
384 | hbox = g_object_get_data(G_OBJECT(dialog->protocol_menu), "container"); |
|
41565
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
385 | gtk_box_remove(GTK_BOX(hbox), dialog->protocol_menu); |
|
17035
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
386 | } |
|
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
387 | |
|
41565
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
388 | if (dialog->login_frame != NULL) { |
|
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
389 | gtk_widget_unparent(dialog->login_frame); |
|
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
390 | } |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
391 | |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
392 | /* Build the login options frame. */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
393 | frame = pidgin_make_frame(parent, _("Login Options")); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
394 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
395 | /* cringe */ |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
396 | dialog->login_frame = gtk_widget_get_parent(gtk_widget_get_parent(frame)); |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
397 | |
|
41565
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
398 | gtk_box_reorder_child_after(GTK_BOX(parent), dialog->login_frame, NULL); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
399 | |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
400 | /* Main vbox */ |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
401 | vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6); |
|
41565
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
402 | gtk_box_append(GTK_BOX(frame), vbox); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
403 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
404 | /* Protocol */ |
|
40297
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
405 | if(dialog->protocol_menu == NULL) { |
|
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
406 | dialog->protocol_menu = pidgin_protocol_chooser_new(); |
|
40741
850137e8737c
Select the proper protocol in the account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
40707
diff
changeset
|
407 | pidgin_protocol_chooser_set_selected_id(PIDGIN_PROTOCOL_CHOOSER(dialog->protocol_menu), |
|
850137e8737c
Select the proper protocol in the account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
40707
diff
changeset
|
408 | dialog->protocol_id); |
|
40297
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
409 | g_signal_connect(G_OBJECT(dialog->protocol_menu), "changed", |
|
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
410 | G_CALLBACK(set_account_protocol_cb), dialog); |
|
26820
76f90ca8f6f2
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26543
diff
changeset
|
411 | g_object_ref(G_OBJECT(dialog->protocol_menu)); |
|
17035
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
412 | } |
|
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
413 | |
|
17563
eb3c8a19ceff
Add some mnemonics to the new/modify account dialog. These are also taken
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17562
diff
changeset
|
414 | hbox = add_pref_box(dialog, vbox, _("Pro_tocol:"), dialog->protocol_menu); |
|
17035
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
415 | g_object_set_data(G_OBJECT(dialog->protocol_menu), "container", hbox); |
|
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
416 | |
|
26820
76f90ca8f6f2
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26543
diff
changeset
|
417 | g_object_unref(G_OBJECT(dialog->protocol_menu)); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
418 | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
419 | /* Username */ |
|
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
420 | dialog->username_entry = gtk_entry_new(); |
|
39050
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
421 | gtk_style_context_add_provider( |
|
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
422 | gtk_widget_get_style_context(dialog->username_entry), |
|
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
423 | GTK_STYLE_PROVIDER(entry_css), |
|
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
424 | GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
425 | g_object_set(G_OBJECT(dialog->username_entry), "truncate-multiline", TRUE, NULL); |
|
6751
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
426 | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
427 | add_pref_box(dialog, vbox, _("_Username:"), dialog->username_entry); |
|
6751
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
428 | |
|
23277
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
429 | if (dialog->account != NULL) |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
430 | username = g_strdup(purple_account_get_username(dialog->account)); |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
431 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
432 | if (!username && dialog->protocol |
|
39759
ea1401483849
Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39611
diff
changeset
|
433 | && PURPLE_PROTOCOL_IMPLEMENTS(dialog->protocol, CLIENT, get_account_text_table)) { |
|
23277
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
434 | GHashTable *table; |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
435 | const char *label; |
|
40634
4d3018b00ad4
Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
40552
diff
changeset
|
436 | table = purple_protocol_client_get_account_text_table(PURPLE_PROTOCOL_CLIENT(dialog->protocol), NULL); |
|
23277
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
437 | label = g_hash_table_lookup(table, "login_label"); |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
438 | |
|
33705
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
439 | gtk_entry_set_placeholder_text(GTK_ENTRY(dialog->username_entry), label); |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
440 | |
|
23277
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
441 | g_hash_table_destroy(table); |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
442 | } |
|
6751
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
443 | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
444 | g_signal_connect(G_OBJECT(dialog->username_entry), "changed", |
|
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
445 | G_CALLBACK(username_changed_cb), dialog); |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
446 | |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
447 | /* Do the user split thang */ |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
448 | if (dialog->protocol == NULL) |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
449 | user_splits = NULL; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
450 | else |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
451 | user_splits = purple_protocol_get_user_splits(dialog->protocol); |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
452 | |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
453 | if (dialog->user_split_entries != NULL) { |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
454 | g_list_free(dialog->user_split_entries); |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
455 | dialog->user_split_entries = NULL; |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
456 | } |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
457 | |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
458 | for (l = user_splits; l != NULL; l = l->next) { |
| 15884 | 459 | PurpleAccountUserSplit *split = l->data; |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
460 | char *buf; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
461 | |
|
36020
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36019
diff
changeset
|
462 | if (purple_account_user_split_is_constant(split)) |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36019
diff
changeset
|
463 | entry = NULL; |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36019
diff
changeset
|
464 | else { |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36019
diff
changeset
|
465 | buf = g_strdup_printf("_%s:", purple_account_user_split_get_text(split)); |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36019
diff
changeset
|
466 | entry = gtk_entry_new(); |
|
39050
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
467 | gtk_style_context_add_provider( |
|
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
468 | gtk_widget_get_style_context(entry), |
|
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
469 | GTK_STYLE_PROVIDER(entry_css), |
|
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
470 | GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); |
|
36020
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36019
diff
changeset
|
471 | add_pref_box(dialog, vbox, buf, entry); |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36019
diff
changeset
|
472 | g_free(buf); |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36019
diff
changeset
|
473 | } |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
474 | |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
475 | dialog->user_split_entries = |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
476 | g_list_append(dialog->user_split_entries, entry); |
|
5651
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
477 | } |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
478 | |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
479 | for (l = g_list_last(dialog->user_split_entries), |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
480 | l2 = g_list_last(user_splits); |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
481 | l != NULL && l2 != NULL; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
482 | l = l->prev, l2 = l2->prev) { |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
483 | |
|
5708
43f6fbb894d5
[gaim-migrate @ 6129]
Christian Hammond <chipx86@chipx86.com>
parents:
5705
diff
changeset
|
484 | GtkWidget *entry = l->data; |
| 15884 | 485 | PurpleAccountUserSplit *split = l2->data; |
|
17851
02fbbecd95f5
Make sure if some plugin used pidgin_protocol_option_menu_new, they continue
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17302
diff
changeset
|
486 | const char *value = NULL; |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
487 | char *c; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
488 | |
|
35689
1e257009ac10
Fix Pidgin clang scan-build warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35527
diff
changeset
|
489 | if (dialog->account != NULL && username != NULL) { |
|
18099
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
18096
diff
changeset
|
490 | if(purple_account_user_split_get_reverse(split)) |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
18096
diff
changeset
|
491 | c = strrchr(username, |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
18096
diff
changeset
|
492 | purple_account_user_split_get_separator(split)); |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
18096
diff
changeset
|
493 | else |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
18096
diff
changeset
|
494 | c = strchr(username, |
| 15884 | 495 | purple_account_user_split_get_separator(split)); |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
496 | |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
497 | if (c != NULL) { |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
498 | *c = '\0'; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
499 | c++; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
500 | |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
501 | value = c; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
502 | } |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
503 | } |
|
5656
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
504 | if (value == NULL) |
| 15884 | 505 | value = purple_account_user_split_get_default_value(split); |
|
5656
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
506 | |
|
41531
2b86501d13fe
Replace gtk_entry_[gs]et_text with gtk_editable_[gs]et_text
Gary Kramlich <grim@reaperworld.com>
parents:
41526
diff
changeset
|
507 | if (value != NULL && entry != NULL) { |
|
2b86501d13fe
Replace gtk_entry_[gs]et_text with gtk_editable_[gs]et_text
Gary Kramlich <grim@reaperworld.com>
parents:
41526
diff
changeset
|
508 | gtk_editable_set_text(GTK_EDITABLE(entry), value); |
|
2b86501d13fe
Replace gtk_entry_[gs]et_text with gtk_editable_[gs]et_text
Gary Kramlich <grim@reaperworld.com>
parents:
41526
diff
changeset
|
509 | } |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
510 | } |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
511 | |
|
40813
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
512 | g_list_free_full(user_splits, |
|
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
513 | (GDestroyNotify)purple_account_user_split_destroy); |
|
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
514 | |
|
41531
2b86501d13fe
Replace gtk_entry_[gs]et_text with gtk_editable_[gs]et_text
Gary Kramlich <grim@reaperworld.com>
parents:
41526
diff
changeset
|
515 | if (username != NULL) { |
|
2b86501d13fe
Replace gtk_entry_[gs]et_text with gtk_editable_[gs]et_text
Gary Kramlich <grim@reaperworld.com>
parents:
41526
diff
changeset
|
516 | gtk_editable_set_text(GTK_EDITABLE(dialog->username_entry), username); |
|
2b86501d13fe
Replace gtk_entry_[gs]et_text with gtk_editable_[gs]et_text
Gary Kramlich <grim@reaperworld.com>
parents:
41526
diff
changeset
|
517 | } |
|
5656
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
518 | |
|
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
519 | g_free(username); |
|
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
520 | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
521 | /* Do not let the user change the protocol/username while connected. */ |
|
12555
3c978a4400f2
[gaim-migrate @ 14874]
Richard Laager <rlaager@pidgin.im>
parents:
12521
diff
changeset
|
522 | update_editable(NULL, dialog); |
| 15884 | 523 | purple_signal_connect(purple_connections_get_handle(), "signing-on", dialog, |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
524 | G_CALLBACK(update_editable), dialog); |
| 15884 | 525 | purple_signal_connect(purple_connections_get_handle(), "signed-off", dialog, |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
526 | G_CALLBACK(update_editable), dialog); |
|
39050
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
527 | |
|
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
528 | g_object_unref(entry_css); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
529 | } |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
530 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
531 | static void |
| 14195 | 532 | icon_check_cb(GtkWidget *checkbox, AccountPrefsDialog *dialog) |
| 533 | { | |
| 534 | gtk_widget_set_sensitive(dialog->icon_hbox, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->icon_check))); | |
| 535 | } | |
| 536 | ||
| 537 | static void | |
| 5774 | 538 | add_user_options(AccountPrefsDialog *dialog, GtkWidget *parent) |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
539 | { |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
540 | GtkWidget *frame; |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
541 | GtkWidget *vbox; |
|
9333
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
542 | GtkWidget *vbox2; |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
543 | GtkWidget *hbox; |
|
9333
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
544 | GtkWidget *hbox2; |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
545 | GtkWidget *button; |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
546 | GtkWidget *label; |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
547 | |
|
41565
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
548 | if (dialog->user_frame != NULL) { |
|
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
549 | gtk_widget_unparent(dialog->user_frame); |
|
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
550 | } |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
551 | |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
552 | /* Build the user options frame. */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
553 | frame = pidgin_make_frame(parent, _("User Options")); |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
554 | dialog->user_frame = gtk_widget_get_parent(gtk_widget_get_parent(frame)); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
555 | |
|
41565
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
556 | gtk_box_reorder_child_after(GTK_BOX(parent), dialog->user_frame, |
|
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
557 | gtk_widget_get_first_child(parent)); |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
558 | |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
559 | /* Main vbox */ |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
560 | vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6); |
|
41565
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
561 | gtk_box_append(GTK_BOX(frame), vbox); |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
562 | |
|
22933
fe1e09e03bcb
Move the Local Alias field into the User Options section of the account
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22455
diff
changeset
|
563 | /* Alias */ |
|
fe1e09e03bcb
Move the Local Alias field into the User Options section of the account
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22455
diff
changeset
|
564 | dialog->alias_entry = gtk_entry_new(); |
|
fe1e09e03bcb
Move the Local Alias field into the User Options section of the account
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22455
diff
changeset
|
565 | add_pref_box(dialog, vbox, _("_Local alias:"), dialog->alias_entry); |
|
fe1e09e03bcb
Move the Local Alias field into the User Options section of the account
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22455
diff
changeset
|
566 | |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
567 | /* Buddy icon */ |
|
17563
eb3c8a19ceff
Add some mnemonics to the new/modify account dialog. These are also taken
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17562
diff
changeset
|
568 | dialog->icon_check = gtk_check_button_new_with_mnemonic(_("Use this buddy _icon for this account:")); |
| 14195 | 569 | g_signal_connect(G_OBJECT(dialog->icon_check), "toggled", G_CALLBACK(icon_check_cb), dialog); |
|
41565
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
570 | gtk_box_append(GTK_BOX(vbox), dialog->icon_check); |
| 14195 | 571 | |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
572 | dialog->icon_hbox = hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6); |
| 14195 | 573 | gtk_widget_set_sensitive(hbox, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->icon_check))); |
|
41565
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
574 | gtk_box_append(GTK_BOX(vbox), hbox); |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
575 | |
| 14195 | 576 | label = gtk_label_new(" "); |
|
41565
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
577 | gtk_box_append(GTK_BOX(hbox), label); |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
578 | |
|
14764
1a07873891aa
[gaim-migrate @ 17454]
Mark Doliner <markdoliner@pidgin.im>
parents:
14671
diff
changeset
|
579 | button = gtk_button_new(); |
|
41565
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
580 | gtk_box_append(GTK_BOX(hbox), button); |
|
14764
1a07873891aa
[gaim-migrate @ 17454]
Mark Doliner <markdoliner@pidgin.im>
parents:
14671
diff
changeset
|
581 | g_signal_connect(G_OBJECT(button), "clicked", |
|
1a07873891aa
[gaim-migrate @ 17454]
Mark Doliner <markdoliner@pidgin.im>
parents:
14671
diff
changeset
|
582 | G_CALLBACK(icon_select_cb), dialog); |
|
1a07873891aa
[gaim-migrate @ 17454]
Mark Doliner <markdoliner@pidgin.im>
parents:
14671
diff
changeset
|
583 | |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
584 | dialog->icon_entry = gtk_image_new(); |
|
41565
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
585 | gtk_button_set_child(GTK_BUTTON(button), dialog->icon_entry); |
|
14764
1a07873891aa
[gaim-migrate @ 17454]
Mark Doliner <markdoliner@pidgin.im>
parents:
14671
diff
changeset
|
586 | /* TODO: Uh, isn't this next line pretty useless? */ |
|
35721
abae078d0525
Fix some warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35527
diff
changeset
|
587 | pidgin_set_accessible_label(dialog->icon_entry, GTK_LABEL(label)); |
|
35818
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
588 | if (dialog->icon_img) { |
|
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
589 | g_object_unref(dialog->icon_img); |
|
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
590 | dialog->icon_img = NULL; |
|
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
591 | } |
|
9333
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
592 | |
|
35527
707c3c2b2c8a
Fix more gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35510
diff
changeset
|
593 | vbox2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); |
|
41565
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
594 | gtk_widget_set_hexpand(vbox2, TRUE); |
|
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
595 | gtk_widget_set_halign(vbox2, GTK_ALIGN_FILL); |
|
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
596 | gtk_box_append(GTK_BOX(hbox), vbox2); |
|
9333
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
597 | |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
598 | hbox2 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6); |
|
41565
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
599 | gtk_widget_set_margin_top(hbox2, 12); |
|
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
600 | gtk_widget_set_margin_bottom(hbox2, 12); |
|
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
601 | gtk_box_append(GTK_BOX(vbox2), hbox2); |
|
9333
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
602 | |
|
39051
1b8c6378f8ba
gtkaccount: Replace GTK_STOCK_* and PIDGIN_STOCK_* usage with strings
Mike Ruprecht <cmaiku@gmail.com>
parents:
39050
diff
changeset
|
603 | button = gtk_button_new_with_mnemonic(_("_Remove")); |
| 5826 | 604 | g_signal_connect(G_OBJECT(button), "clicked", |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
605 | G_CALLBACK(icon_reset_cb), dialog); |
|
41565
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
606 | gtk_box_append(GTK_BOX(hbox2), button); |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
607 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
608 | if (dialog->protocol != NULL) { |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
609 | PurpleBuddyIconSpec *icon_spec = purple_protocol_get_icon_spec(dialog->protocol); |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
610 | |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
611 | if (!icon_spec || icon_spec->format == NULL) { |
|
19764
9485b7cccfca
If a prpl doesn't support icons then hide the "use a custom icon?"
Mark Doliner <markdoliner@pidgin.im>
parents:
19683
diff
changeset
|
612 | gtk_widget_hide(dialog->icon_check); |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
613 | gtk_widget_hide(dialog->icon_hbox); |
| 19773 | 614 | } |
|
40813
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
615 | |
|
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
616 | purple_buddy_icon_spec_free(icon_spec); |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
617 | } |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
618 | |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
619 | if (dialog->account != NULL) { |
|
35818
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
620 | PurpleImage *img; |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
621 | gpointer data = NULL; |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
622 | size_t len = 0; |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
623 | |
|
41531
2b86501d13fe
Replace gtk_entry_[gs]et_text with gtk_editable_[gs]et_text
Gary Kramlich <grim@reaperworld.com>
parents:
41526
diff
changeset
|
624 | if (purple_account_get_private_alias(dialog->account)) { |
|
2b86501d13fe
Replace gtk_entry_[gs]et_text with gtk_editable_[gs]et_text
Gary Kramlich <grim@reaperworld.com>
parents:
41526
diff
changeset
|
625 | gtk_editable_set_text(GTK_EDITABLE(dialog->alias_entry), |
|
2b86501d13fe
Replace gtk_entry_[gs]et_text with gtk_editable_[gs]et_text
Gary Kramlich <grim@reaperworld.com>
parents:
41526
diff
changeset
|
626 | purple_account_get_private_alias(dialog->account)); |
|
2b86501d13fe
Replace gtk_entry_[gs]et_text with gtk_editable_[gs]et_text
Gary Kramlich <grim@reaperworld.com>
parents:
41526
diff
changeset
|
627 | } |
|
22982
bd5a732d899b
Fix the breakage with account aliases that I introduced when I moved the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22942
diff
changeset
|
628 | |
| 14195 | 629 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->icon_check), |
| 15884 | 630 | !purple_account_get_bool(dialog->account, "use-global-buddyicon", |
| 14195 | 631 | TRUE)); |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
632 | |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
633 | img = purple_buddy_icons_find_account_icon(dialog->account); |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
634 | if (img) |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
635 | { |
|
38298
f0a8f63f9312
rename purple_image_get_size to purple_image_get_data_size and deal with the fallout
Gary Kramlich <grim@reaperworld.com>
parents:
38285
diff
changeset
|
636 | len = purple_image_get_data_size(img); |
|
40756
3a58ef28ee44
Implement mitigation for GHSL-2021-045
Gary Kramlich <grim@reaperworld.com>
parents:
40741
diff
changeset
|
637 | data = g_memdup2(purple_image_get_data(img), len); |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
638 | } |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
639 | set_dialog_icon(dialog, data, len, |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
640 | g_strdup(purple_account_get_buddy_icon_path(dialog->account))); |
|
15132
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
15119
diff
changeset
|
641 | } else { |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
642 | set_dialog_icon(dialog, NULL, 0, NULL); |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
643 | } |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
644 | |
|
22940
380c5bd5df65
This fixes the lack of the Local Alias field for IRC accounts since I moved
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22933
diff
changeset
|
645 | #if 0 |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
646 | if (!dialog->protocol || |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
647 | (!(purple_protocol_get_options(dialog->protocol) & OPT_PROTO_MAIL_CHECK) && |
|
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
648 | (purple_protocol_get_icon_spec(dialog->protocol).format == NULL))) { |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
649 | |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
650 | /* Nothing to see :( aww. */ |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
651 | gtk_widget_hide(dialog->user_frame); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
652 | } |
|
22940
380c5bd5df65
This fixes the lack of the Local Alias field for IRC accounts since I moved
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22933
diff
changeset
|
653 | #endif |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
654 | } |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
655 | |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
656 | static void |
|
40137
016690872c6c
Add new and free functions for structs to reduce duplication
qarkai <qarkai@gmail.com>
parents:
40046
diff
changeset
|
657 | protocol_opt_entry_free(ProtocolOptEntry *opt_entry) |
|
016690872c6c
Add new and free functions for structs to reduce duplication
qarkai <qarkai@gmail.com>
parents:
40046
diff
changeset
|
658 | { |
| 40139 | 659 | g_return_if_fail(opt_entry != NULL); |
| 660 | ||
|
40137
016690872c6c
Add new and free functions for structs to reduce duplication
qarkai <qarkai@gmail.com>
parents:
40046
diff
changeset
|
661 | g_free(opt_entry->setting); |
|
016690872c6c
Add new and free functions for structs to reduce duplication
qarkai <qarkai@gmail.com>
parents:
40046
diff
changeset
|
662 | g_free(opt_entry); |
|
016690872c6c
Add new and free functions for structs to reduce duplication
qarkai <qarkai@gmail.com>
parents:
40046
diff
changeset
|
663 | } |
|
016690872c6c
Add new and free functions for structs to reduce duplication
qarkai <qarkai@gmail.com>
parents:
40046
diff
changeset
|
664 | |
|
016690872c6c
Add new and free functions for structs to reduce duplication
qarkai <qarkai@gmail.com>
parents:
40046
diff
changeset
|
665 | static void |
|
37038
8832d14d7d0c
Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents:
36928
diff
changeset
|
666 | add_account_options(AccountPrefsDialog *dialog) |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
667 | { |
| 15884 | 668 | PurpleAccountOption *option; |
| 669 | PurpleAccount *account; | |
|
38091
be8d0f7d0041
Remove Facebook (XMPP) account option and support code
Mike Ruprecht <cmaiku@gmail.com>
parents:
35929
diff
changeset
|
670 | GtkWidget *vbox, *check, *entry, *combo; |
|
40813
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
671 | GList *list, *node, *opts; |
| 12185 | 672 | gint i, idx, int_value; |
| 12106 | 673 | GtkListStore *model; |
| 674 | GtkTreeIter iter; | |
| 675 | GtkCellRenderer *renderer; | |
| 15884 | 676 | PurpleKeyValuePair *kvp; |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
677 | GList *l; |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
678 | char buf[1024]; |
|
17672
a5c4e192659a
Add mnemonics to prpl provided account options, from OpenSolaris patch
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17654
diff
changeset
|
679 | char *title, *tmp; |
|
17851
02fbbecd95f5
Make sure if some plugin used pidgin_protocol_option_menu_new, they continue
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17302
diff
changeset
|
680 | const char *str_value; |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
681 | gboolean bool_value; |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
682 | ProtocolOptEntry *opt_entry; |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
683 | const GSList *str_hints; |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
684 | |
|
5689
340d70c1ba9d
[gaim-migrate @ 6110]
Christian Hammond <chipx86@chipx86.com>
parents:
5688
diff
changeset
|
685 | if (dialog->protocol_frame != NULL) { |
|
26543
2ff0a924a18e
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26475
diff
changeset
|
686 | gtk_notebook_remove_page (GTK_NOTEBOOK(dialog->notebook), 1); |
|
5689
340d70c1ba9d
[gaim-migrate @ 6110]
Christian Hammond <chipx86@chipx86.com>
parents:
5688
diff
changeset
|
687 | dialog->protocol_frame = NULL; |
|
340d70c1ba9d
[gaim-migrate @ 6110]
Christian Hammond <chipx86@chipx86.com>
parents:
5688
diff
changeset
|
688 | } |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
689 | |
|
40137
016690872c6c
Add new and free functions for structs to reduce duplication
qarkai <qarkai@gmail.com>
parents:
40046
diff
changeset
|
690 | g_list_free_full(dialog->protocol_opt_entries, (GDestroyNotify)protocol_opt_entry_free); |
| 40141 | 691 | dialog->protocol_opt_entries = NULL; |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
692 | |
|
40813
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
693 | if (dialog->protocol == NULL) { |
|
25730
c2698534cbb1
Backport 96cf043274a971d5a2b9e01ef85fb60ca2a4bcd1 (#8747 - Crash when a prpl has no protocol options.)
Daniel Atallah <datallah@pidgin.im>
parents:
25529
diff
changeset
|
694 | return; |
|
40813
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
695 | } |
|
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
696 | |
|
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
697 | opts = purple_protocol_get_account_options(dialog->protocol); |
|
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
698 | if(opts == NULL) { |
|
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
699 | return; |
|
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
700 | } |
|
25730
c2698534cbb1
Backport 96cf043274a971d5a2b9e01ef85fb60ca2a4bcd1 (#8747 - Crash when a prpl has no protocol options.)
Daniel Atallah <datallah@pidgin.im>
parents:
25529
diff
changeset
|
701 | |
|
5690
282596819f53
[gaim-migrate @ 6111]
Christian Hammond <chipx86@chipx86.com>
parents:
5689
diff
changeset
|
702 | account = dialog->account; |
|
282596819f53
[gaim-migrate @ 6111]
Christian Hammond <chipx86@chipx86.com>
parents:
5689
diff
changeset
|
703 | |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
704 | /* Main vbox */ |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
705 | dialog->protocol_frame = vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6); |
|
26543
2ff0a924a18e
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26475
diff
changeset
|
706 | gtk_notebook_insert_page(GTK_NOTEBOOK(dialog->notebook), vbox, |
|
27668
536cb7a2d348
s/_Advanced/Ad_vanced/ and s/_Proxy/P_roxy/ in the tabs of the Add/Modify
Etan Reisner <deryni@pidgin.im>
parents:
27603
diff
changeset
|
707 | gtk_label_new_with_mnemonic(_("Ad_vanced")), 1); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
708 | |
|
40813
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
709 | for (l = opts; l != NULL; l = l->next) |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
710 | { |
| 15884 | 711 | option = (PurpleAccountOption *)l->data; |
| 712 | ||
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
713 | opt_entry = g_new0(ProtocolOptEntry, 1); |
|
35378
5d9e2581005b
gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents:
35040
diff
changeset
|
714 | opt_entry->type = purple_account_option_get_pref_type(option); |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
715 | opt_entry->setting = g_strdup(purple_account_option_get_setting(option)); |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
716 | |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
717 | switch (opt_entry->type) |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
718 | { |
| 15884 | 719 | case PURPLE_PREF_BOOLEAN: |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
720 | if (account == NULL || |
|
38259
c593fc9f5438
Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
38258
diff
changeset
|
721 | !purple_strequal(purple_account_get_protocol_id(account), |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
722 | dialog->protocol_id)) |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
723 | { |
| 15884 | 724 | bool_value = purple_account_option_get_default_bool(option); |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
725 | } |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
726 | else |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
727 | { |
| 15884 | 728 | bool_value = purple_account_get_bool(account, |
| 729 | purple_account_option_get_setting(option), | |
| 730 | purple_account_option_get_default_bool(option)); | |
| 7956 | 731 | } |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
732 | |
|
17672
a5c4e192659a
Add mnemonics to prpl provided account options, from OpenSolaris patch
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17654
diff
changeset
|
733 | tmp = g_strconcat("_", purple_account_option_get_text(option), NULL); |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
734 | opt_entry->widget = check = gtk_check_button_new_with_mnemonic(tmp); |
|
17672
a5c4e192659a
Add mnemonics to prpl provided account options, from OpenSolaris patch
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17654
diff
changeset
|
735 | g_free(tmp); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
736 | |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
737 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
738 | bool_value); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
739 | |
|
41565
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
740 | gtk_box_append(GTK_BOX(vbox), check); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
741 | break; |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
742 | |
| 15884 | 743 | case PURPLE_PREF_INT: |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
744 | if (account == NULL || |
|
38259
c593fc9f5438
Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
38258
diff
changeset
|
745 | !purple_strequal(purple_account_get_protocol_id(account), |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
746 | dialog->protocol_id)) |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
747 | { |
| 15884 | 748 | int_value = purple_account_option_get_default_int(option); |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
749 | } |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
750 | else |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
751 | { |
| 15884 | 752 | int_value = purple_account_get_int(account, |
| 753 | purple_account_option_get_setting(option), | |
| 754 | purple_account_option_get_default_int(option)); | |
| 7956 | 755 | } |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
756 | |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
757 | g_snprintf(buf, sizeof(buf), "%d", int_value); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
758 | |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
759 | opt_entry->widget = entry = gtk_entry_new(); |
|
41531
2b86501d13fe
Replace gtk_entry_[gs]et_text with gtk_editable_[gs]et_text
Gary Kramlich <grim@reaperworld.com>
parents:
41526
diff
changeset
|
760 | gtk_editable_set_text(GTK_EDITABLE(entry), buf); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
761 | |
|
17672
a5c4e192659a
Add mnemonics to prpl provided account options, from OpenSolaris patch
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17654
diff
changeset
|
762 | title = g_strdup_printf("_%s:", |
| 15884 | 763 | purple_account_option_get_text(option)); |
| 5774 | 764 | add_pref_box(dialog, vbox, title, entry); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
765 | g_free(title); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
766 | break; |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
767 | |
| 15884 | 768 | case PURPLE_PREF_STRING: |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
769 | if (account == NULL || |
|
38259
c593fc9f5438
Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
38258
diff
changeset
|
770 | !purple_strequal(purple_account_get_protocol_id(account), |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
771 | dialog->protocol_id)) |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
772 | { |
| 15884 | 773 | str_value = purple_account_option_get_default_string(option); |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
774 | } |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
775 | else |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
776 | { |
| 15884 | 777 | str_value = purple_account_get_string(account, |
| 778 | purple_account_option_get_setting(option), | |
| 779 | purple_account_option_get_default_string(option)); | |
| 7956 | 780 | } |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
781 | |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
782 | str_hints = purple_account_option_string_get_hints(option); |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
783 | if (str_hints) |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
784 | { |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
785 | const GSList *hint_it = str_hints; |
|
33268
a24713d9bbb3
Fix GTK+3 compile.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33267
diff
changeset
|
786 | entry = gtk_combo_box_text_new_with_entry(); |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
787 | while (hint_it) |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
788 | { |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
789 | const gchar *hint = hint_it->data; |
|
33268
a24713d9bbb3
Fix GTK+3 compile.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33267
diff
changeset
|
790 | hint_it = g_slist_next(hint_it); |
|
a24713d9bbb3
Fix GTK+3 compile.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33267
diff
changeset
|
791 | gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(entry), |
|
a24713d9bbb3
Fix GTK+3 compile.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33267
diff
changeset
|
792 | hint); |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
793 | } |
|
41565
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
794 | if (str_value != NULL) { |
|
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
795 | GtkWidget *real_entry = NULL; |
|
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
796 | real_entry = gtk_combo_box_get_child(GTK_COMBO_BOX(entry)); |
|
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
797 | gtk_editable_set_text(GTK_EDITABLE(real_entry), |
|
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
798 | str_value); |
|
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
799 | } |
|
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
800 | } else { |
|
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
801 | entry = gtk_entry_new(); |
|
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
802 | gtk_editable_set_text(GTK_EDITABLE(entry), |
|
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
803 | str_value ? str_value : ""); |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
804 | } |
|
41565
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
805 | |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
806 | opt_entry->widget = entry; |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
807 | if (purple_account_option_string_get_masked(option) && str_hints) |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
808 | g_warn_if_reached(); |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
809 | else if (purple_account_option_string_get_masked(option)) |
|
11986
21d2ab6421a7
[gaim-migrate @ 14279]
Mark Doliner <markdoliner@pidgin.im>
parents:
11985
diff
changeset
|
810 | { |
|
10658
6223ea383921
[gaim-migrate @ 12190]
Richard Laager <rlaager@pidgin.im>
parents:
10649
diff
changeset
|
811 | gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); |
|
11986
21d2ab6421a7
[gaim-migrate @ 14279]
Mark Doliner <markdoliner@pidgin.im>
parents:
11985
diff
changeset
|
812 | } |
|
5663
05c9effe5b5f
[gaim-migrate @ 6077]
Christian Hammond <chipx86@chipx86.com>
parents:
5662
diff
changeset
|
813 | |
|
17672
a5c4e192659a
Add mnemonics to prpl provided account options, from OpenSolaris patch
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17654
diff
changeset
|
814 | title = g_strdup_printf("_%s:", |
| 15884 | 815 | purple_account_option_get_text(option)); |
| 5774 | 816 | add_pref_box(dialog, vbox, title, entry); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
817 | g_free(title); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
818 | break; |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
819 | |
| 15884 | 820 | case PURPLE_PREF_STRING_LIST: |
| 12106 | 821 | i = 0; |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12152
diff
changeset
|
822 | idx = 0; |
| 12106 | 823 | |
| 824 | if (account == NULL || | |
|
38259
c593fc9f5438
Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
38258
diff
changeset
|
825 | !purple_strequal(purple_account_get_protocol_id(account), |
| 12106 | 826 | dialog->protocol_id)) |
| 827 | { | |
| 15884 | 828 | str_value = purple_account_option_get_default_list_value(option); |
| 12106 | 829 | } |
| 830 | else | |
| 831 | { | |
| 15884 | 832 | str_value = purple_account_get_string(account, |
| 833 | purple_account_option_get_setting(option), | |
| 834 | purple_account_option_get_default_list_value(option)); | |
| 12106 | 835 | } |
| 836 | ||
| 15884 | 837 | list = purple_account_option_get_list(option); |
| 12106 | 838 | model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_POINTER); |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
839 | opt_entry->widget = combo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(model)); |
| 12106 | 840 | |
| 15884 | 841 | /* Loop through list of PurpleKeyValuePair items */ |
| 12106 | 842 | for (node = list; node != NULL; node = node->next) { |
| 843 | if (node->data != NULL) { | |
| 15884 | 844 | kvp = (PurpleKeyValuePair *) node->data; |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12152
diff
changeset
|
845 | if ((kvp->value != NULL) && (str_value != NULL) && |
|
15080
bb09a291a99b
[gaim-migrate @ 17800]
Daniel Atallah <datallah@pidgin.im>
parents:
15054
diff
changeset
|
846 | !g_utf8_collate(kvp->value, str_value)) |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12152
diff
changeset
|
847 | idx = i; |
| 12106 | 848 | |
| 849 | gtk_list_store_append(model, &iter); | |
| 850 | gtk_list_store_set(model, &iter, | |
| 851 | 0, kvp->key, | |
| 852 | 1, kvp->value, | |
| 853 | -1); | |
| 854 | } | |
| 855 | ||
| 856 | i++; | |
| 857 | } | |
| 858 | ||
| 859 | /* Set default */ | |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12152
diff
changeset
|
860 | gtk_combo_box_set_active(GTK_COMBO_BOX(combo), idx); |
| 12106 | 861 | |
| 862 | /* Define renderer */ | |
| 863 | renderer = gtk_cell_renderer_text_new(); | |
| 864 | gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), renderer, | |
| 865 | TRUE); | |
| 866 | gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo), | |
| 867 | renderer, "text", 0, NULL); | |
| 868 | ||
|
17672
a5c4e192659a
Add mnemonics to prpl provided account options, from OpenSolaris patch
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17654
diff
changeset
|
869 | title = g_strdup_printf("_%s:", |
| 15884 | 870 | purple_account_option_get_text(option)); |
| 12106 | 871 | add_pref_box(dialog, vbox, title, combo); |
| 872 | g_free(title); | |
| 873 | break; | |
| 874 | ||
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
875 | default: |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
876 | purple_debug_error("gtkaccount", "Invalid Account Option pref type (%d)\n", |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
877 | opt_entry->type); |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
878 | g_free(opt_entry->setting); |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
879 | g_free(opt_entry); |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
880 | continue; |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
881 | } |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
882 | |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
883 | dialog->protocol_opt_entries = |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
884 | g_list_append(dialog->protocol_opt_entries, opt_entry); |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
885 | |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
886 | } |
|
40813
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
887 | g_list_free_full(opts, (GDestroyNotify)purple_account_option_destroy); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
888 | } |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
889 | |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
890 | static void |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
891 | add_voice_options(AccountPrefsDialog *dialog) |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
892 | { |
|
39759
ea1401483849
Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39611
diff
changeset
|
893 | if (!dialog->protocol || !PURPLE_PROTOCOL_IMPLEMENTS(dialog->protocol, MEDIA, initiate_session)) { |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
894 | if (dialog->voice_frame) { |
|
41565
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
895 | gtk_widget_unparent(dialog->voice_frame); |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
896 | dialog->voice_frame = NULL; |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
897 | dialog->suppression_check = NULL; |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
898 | } |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
899 | return; |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
900 | } |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
901 | |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
902 | if (!dialog->voice_frame) { |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
903 | dialog->voice_frame = gtk_box_new(GTK_ORIENTATION_VERTICAL, 12); |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
904 | |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
905 | dialog->suppression_check = |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
906 | gtk_check_button_new_with_mnemonic(_("Use _silence suppression")); |
|
41565
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
907 | gtk_box_append(GTK_BOX(dialog->voice_frame), dialog->suppression_check); |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
908 | |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
909 | gtk_notebook_append_page(GTK_NOTEBOOK(dialog->notebook), |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
910 | dialog->voice_frame, gtk_label_new_with_mnemonic(_("_Voice and Video"))); |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
911 | } |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
912 | |
|
32931
5aaf2dd75f1c
Use a reasonable default in VV prefs if the account isn't created yet.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32929
diff
changeset
|
913 | if (dialog->account) { |
|
5aaf2dd75f1c
Use a reasonable default in VV prefs if the account isn't created yet.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32929
diff
changeset
|
914 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->suppression_check), |
|
5aaf2dd75f1c
Use a reasonable default in VV prefs if the account isn't created yet.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32929
diff
changeset
|
915 | purple_account_get_silence_suppression(dialog->account)); |
|
5aaf2dd75f1c
Use a reasonable default in VV prefs if the account isn't created yet.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32929
diff
changeset
|
916 | } else { |
|
5aaf2dd75f1c
Use a reasonable default in VV prefs if the account isn't created yet.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32929
diff
changeset
|
917 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->suppression_check), FALSE); |
|
5aaf2dd75f1c
Use a reasonable default in VV prefs if the account isn't created yet.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32929
diff
changeset
|
918 | } |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
919 | } |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
920 | |
|
22032
8136dd5eeda3
Make some more event handlers return appropriate gboolean values. This turns
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22023
diff
changeset
|
921 | static gboolean |
| 5774 | 922 | account_win_destroy_cb(GtkWidget *w, GdkEvent *event, |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
923 | AccountPrefsDialog *dialog) |
|
5692
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
924 | { |
|
41565
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
925 | gtk_window_destroy(GTK_WINDOW(dialog->window)); |
| 7450 | 926 | |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14087
diff
changeset
|
927 | g_list_free(dialog->user_split_entries); |
|
40137
016690872c6c
Add new and free functions for structs to reduce duplication
qarkai <qarkai@gmail.com>
parents:
40046
diff
changeset
|
928 | g_list_free_full(dialog->protocol_opt_entries, (GDestroyNotify)protocol_opt_entry_free); |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14087
diff
changeset
|
929 | g_free(dialog->protocol_id); |
|
21123
7dbce8723eff
Fix a leak of a GtkSizeGroup.
Daniel Atallah <datallah@pidgin.im>
parents:
20228
diff
changeset
|
930 | g_object_unref(dialog->sg); |
|
5978
e9bbb1ec8c89
[gaim-migrate @ 6425]
Christian Hammond <chipx86@chipx86.com>
parents:
5966
diff
changeset
|
931 | |
|
35818
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
932 | if (dialog->icon_img) |
|
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
933 | g_object_unref(dialog->icon_img); |
|
10519
80801a34a246
[gaim-migrate @ 11833]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10432
diff
changeset
|
934 | |
|
39930
411f3df51bcd
Convert to GtkFileChooserNative.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
935 | g_clear_object(&dialog->icon_filesel); |
| 5826 | 936 | |
| 15884 | 937 | purple_signals_disconnect_by_handle(dialog); |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
938 | |
|
5692
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
939 | g_free(dialog); |
|
22032
8136dd5eeda3
Make some more event handlers return appropriate gboolean values. This turns
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22023
diff
changeset
|
940 | return FALSE; |
|
5692
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
941 | } |
|
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
942 | |
|
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
943 | static void |
|
33055
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
944 | account_register_cb(PurpleAccount *account, gboolean succeeded, void *user_data) |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
945 | { |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
946 | if (succeeded) |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
947 | { |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
948 | const PurpleSavedStatus *saved_status = purple_savedstatus_get_current(); |
|
34585
cc4b9443deb9
Renamed pidgin_account_[init,uninit,get_handle] to pidgin_accounts_[init,uninit,get_handle].
Ankit Vani <a@nevitus.org>
parents:
34145
diff
changeset
|
949 | purple_signal_emit(pidgin_accounts_get_handle(), "account-modified", account); |
|
33090
99d719d058df
Remove extra trailing whitespace.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33088
diff
changeset
|
950 | |
|
33055
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
951 | if (saved_status != NULL && purple_account_get_remember_password(account)) { |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
952 | purple_savedstatus_activate_for_account(saved_status, account); |
|
41392
b5c84f55d5d2
Remove the ui parameter from purple_account_[gs]et_enabled
Gary Kramlich <grim@reaperworld.com>
parents:
41389
diff
changeset
|
953 | purple_account_set_enabled(account, TRUE); |
|
33055
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
954 | } |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
955 | } |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
956 | else |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
957 | purple_accounts_delete(account); |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
958 | } |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
959 | |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
960 | static void |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
961 | account_prefs_save(AccountPrefsDialog *dialog) { |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
962 | PurpleAccountManager *manager = NULL; |
| 15884 | 963 | PurpleProxyInfo *proxy_info = NULL; |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
964 | GList *l, *l2; |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
965 | const char *value; |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
966 | char *username; |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
967 | char *tmp; |
|
19669
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
968 | gboolean new_acct = FALSE, icon_change = FALSE; |
| 15884 | 969 | PurpleAccount *account; |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
970 | PurpleBuddyIconSpec *icon_spec = NULL; |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
971 | |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
972 | manager = purple_account_manager_get_default(); |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
973 | |
|
19669
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
974 | /* Build the username string. */ |
|
41531
2b86501d13fe
Replace gtk_entry_[gs]et_text with gtk_editable_[gs]et_text
Gary Kramlich <grim@reaperworld.com>
parents:
41526
diff
changeset
|
975 | username = g_strdup(gtk_editable_get_text(GTK_EDITABLE(dialog->username_entry))); |
|
19669
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
976 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
977 | if (dialog->protocol != NULL) |
|
19669
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
978 | { |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
979 | for (l = purple_protocol_get_user_splits(dialog->protocol), |
|
19669
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
980 | l2 = dialog->user_split_entries; |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
981 | l != NULL && l2 != NULL; |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
982 | l = l->next, l2 = l2->next) |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
983 | { |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
984 | PurpleAccountUserSplit *split = l->data; |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
985 | GtkEntry *entry = l2->data; |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
986 | char sep[2] = " "; |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
987 | |
|
41531
2b86501d13fe
Replace gtk_entry_[gs]et_text with gtk_editable_[gs]et_text
Gary Kramlich <grim@reaperworld.com>
parents:
41526
diff
changeset
|
988 | value = entry ? gtk_editable_get_text(GTK_EDITABLE(entry)) : ""; |
|
36020
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36019
diff
changeset
|
989 | if (!value) |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36019
diff
changeset
|
990 | value = ""; |
|
19669
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
991 | |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
992 | *sep = purple_account_user_split_get_separator(split); |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
993 | |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
994 | tmp = g_strconcat(username, sep, |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
995 | (*value ? value : |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
996 | purple_account_user_split_get_default_value(split)), |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
997 | NULL); |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
998 | |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
999 | g_free(username); |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1000 | username = tmp; |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1001 | } |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1002 | } |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1003 | |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1004 | if (dialog->account == NULL) |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1005 | { |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1006 | account = purple_account_manager_find(manager, username, |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1007 | dialog->protocol_id); |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1008 | if(PURPLE_IS_ACCOUNT(account)) { |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1009 | purple_debug_warning("gtkaccount", |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1010 | "Trying to add a duplicate %s account (%s).\n", |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1011 | dialog->protocol_id, username); |
|
19669
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1012 | |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1013 | purple_notify_error(NULL, NULL, _("Unable to save new account"), |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1014 | _("An account already exists with the " |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1015 | "specified criteria."), |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1016 | NULL); |
|
19669
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1017 | |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1018 | g_free(username); |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1019 | |
|
19669
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1020 | return; |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1021 | } |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1022 | |
|
19669
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1023 | account = purple_account_new(username, dialog->protocol_id); |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1024 | new_acct = TRUE; |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1025 | } |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1026 | else |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1027 | { |
|
11739
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11733
diff
changeset
|
1028 | account = dialog->account; |
|
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11733
diff
changeset
|
1029 | |
|
5699
b47a3b7d1247
[gaim-migrate @ 6120]
Christian Hammond <chipx86@chipx86.com>
parents:
5698
diff
changeset
|
1030 | /* Protocol */ |
| 15884 | 1031 | purple_account_set_protocol_id(account, dialog->protocol_id); |
|
5699
b47a3b7d1247
[gaim-migrate @ 6120]
Christian Hammond <chipx86@chipx86.com>
parents:
5698
diff
changeset
|
1032 | } |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1033 | |
|
5697
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1034 | /* Alias */ |
|
41531
2b86501d13fe
Replace gtk_entry_[gs]et_text with gtk_editable_[gs]et_text
Gary Kramlich <grim@reaperworld.com>
parents:
41526
diff
changeset
|
1035 | value = gtk_editable_get_text(GTK_EDITABLE(dialog->alias_entry)); |
|
5697
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1036 | |
|
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1037 | if (*value != '\0') |
|
34589
428e92c79631
Renamed purple_account_[get,set]_alias to purple_account[get,set]_private_alias.
Ankit Vani <a@nevitus.org>
parents:
34586
diff
changeset
|
1038 | purple_account_set_private_alias(account, value); |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1039 | else |
|
34589
428e92c79631
Renamed purple_account_[get,set]_alias to purple_account[get,set]_private_alias.
Ankit Vani <a@nevitus.org>
parents:
34586
diff
changeset
|
1040 | purple_account_set_private_alias(account, NULL); |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1041 | |
|
5697
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1042 | /* Buddy Icon */ |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
1043 | if (dialog->protocol != NULL) |
|
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
1044 | icon_spec = purple_protocol_get_icon_spec(dialog->protocol); |
|
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
1045 | |
|
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
1046 | if (icon_spec && icon_spec->format != NULL) |
|
14313
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1047 | { |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1048 | const char *filename; |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1049 | |
|
19669
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1050 | if (new_acct || purple_account_get_bool(account, "use-global-buddyicon", TRUE) == |
|
14313
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1051 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->icon_check))) |
|
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1052 | { |
|
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1053 | icon_change = TRUE; |
|
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1054 | } |
| 15884 | 1055 | purple_account_set_bool(account, "use-global-buddyicon", !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->icon_check))); |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1056 | |
|
14313
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1057 | if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->icon_check))) |
|
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1058 | { |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1059 | if (dialog->icon_img) |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1060 | { |
|
38298
f0a8f63f9312
rename purple_image_get_size to purple_image_get_data_size and deal with the fallout
Gary Kramlich <grim@reaperworld.com>
parents:
38285
diff
changeset
|
1061 | size_t len = purple_image_get_data_size(dialog->icon_img); |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1062 | purple_buddy_icons_set_account_icon(account, |
|
40756
3a58ef28ee44
Implement mitigation for GHSL-2021-045
Gary Kramlich <grim@reaperworld.com>
parents:
40741
diff
changeset
|
1063 | g_memdup2(purple_image_get_data(dialog->icon_img), len), len); |
|
35818
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
1064 | purple_account_set_buddy_icon_path(account, |
|
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
1065 | purple_image_get_path(dialog->icon_img)); |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1066 | } |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1067 | else |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1068 | { |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1069 | purple_buddy_icons_set_account_icon(account, NULL, 0); |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1070 | purple_account_set_buddy_icon_path(account, NULL); |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1071 | } |
|
14313
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1072 | } |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1073 | else if ((filename = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/accounts/buddyicon")) && icon_change) |
|
14313
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1074 | { |
|
34988
81d8c99ac9b3
Initialize len = 0 before pidgin_convert_buddy_icon()
Ankit Vani <a@nevitus.org>
parents:
34955
diff
changeset
|
1075 | size_t len = 0; |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
1076 | gpointer data = pidgin_convert_buddy_icon(dialog->protocol, filename, &len); |
| 15884 | 1077 | purple_account_set_buddy_icon_path(account, filename); |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1078 | purple_buddy_icons_set_account_icon(account, data, len); |
|
14313
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1079 | } |
| 14195 | 1080 | } |
|
14313
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1081 | |
|
40813
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
1082 | purple_buddy_icon_spec_free(icon_spec); |
|
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
1083 | |
| 15884 | 1084 | purple_account_set_username(account, username); |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1085 | g_free(username); |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1086 | |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1087 | /* Add the protocol settings */ |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
1088 | if (dialog->protocol) { |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1089 | ProtocolOptEntry *opt_entry; |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1090 | GtkTreeIter iter; |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1091 | char *value2; |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1092 | int int_value; |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1093 | gboolean bool_value; |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1094 | |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1095 | for (l2 = dialog->protocol_opt_entries; l2; l2 = l2->next) { |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1096 | |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1097 | opt_entry = l2->data; |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1098 | |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1099 | switch (opt_entry->type) { |
| 15884 | 1100 | case PURPLE_PREF_STRING: |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
1101 | if (GTK_IS_COMBO_BOX(opt_entry->widget)) |
|
33268
a24713d9bbb3
Fix GTK+3 compile.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33267
diff
changeset
|
1102 | value = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(opt_entry->widget)); |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
1103 | else |
|
41531
2b86501d13fe
Replace gtk_entry_[gs]et_text with gtk_editable_[gs]et_text
Gary Kramlich <grim@reaperworld.com>
parents:
41526
diff
changeset
|
1104 | value = gtk_editable_get_text(GTK_EDITABLE(opt_entry->widget)); |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1105 | purple_account_set_string(account, opt_entry->setting, value); |
| 7208 | 1106 | break; |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1107 | |
| 15884 | 1108 | case PURPLE_PREF_INT: |
|
41531
2b86501d13fe
Replace gtk_entry_[gs]et_text with gtk_editable_[gs]et_text
Gary Kramlich <grim@reaperworld.com>
parents:
41526
diff
changeset
|
1109 | int_value = atoi(gtk_editable_get_text(GTK_EDITABLE(opt_entry->widget))); |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1110 | purple_account_set_int(account, opt_entry->setting, int_value); |
| 7208 | 1111 | break; |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1112 | |
| 15884 | 1113 | case PURPLE_PREF_BOOLEAN: |
| 7208 | 1114 | bool_value = |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1115 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(opt_entry->widget)); |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1116 | purple_account_set_bool(account, opt_entry->setting, bool_value); |
| 7208 | 1117 | break; |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1118 | |
| 15884 | 1119 | case PURPLE_PREF_STRING_LIST: |
|
20228
ce019944d765
applied changes from 9d35dde0c779cca73548172223ba557f27d61882
Luke Schierer <lschiere@pidgin.im>
parents:
20147
diff
changeset
|
1120 | value2 = NULL; |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1121 | if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(opt_entry->widget), &iter)) |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1122 | gtk_tree_model_get(gtk_combo_box_get_model(GTK_COMBO_BOX(opt_entry->widget)), &iter, 1, &value2, -1); |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1123 | purple_account_set_string(account, opt_entry->setting, value2); |
| 12106 | 1124 | break; |
| 1125 | ||
| 7208 | 1126 | default: |
| 1127 | break; | |
| 1128 | } | |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1129 | } |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1130 | } |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1131 | |
|
41350
2bdf14aaf7a1
Create a PidginProxyOptions widget
Gary Kramlich <grim@reaperworld.com>
parents:
41320
diff
changeset
|
1132 | proxy_info = pidgin_proxy_options_get_info(PIDGIN_PROXY_OPTIONS(dialog->proxy_options)); |
|
2bdf14aaf7a1
Create a PidginProxyOptions widget
Gary Kramlich <grim@reaperworld.com>
parents:
41320
diff
changeset
|
1133 | purple_account_set_proxy_info(account, proxy_info); |
|
5697
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1134 | |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1135 | /* Voice and Video settings */ |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1136 | if (dialog->voice_frame) { |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1137 | purple_account_set_silence_suppression(account, |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1138 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->suppression_check))); |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1139 | } |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1140 | |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1141 | /* If this is a new account, add it to our list */ |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1142 | if(new_acct) { |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1143 | purple_account_manager_add(manager, account); |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1144 | } else { |
|
34585
cc4b9443deb9
Renamed pidgin_account_[init,uninit,get_handle] to pidgin_accounts_[init,uninit,get_handle].
Ankit Vani <a@nevitus.org>
parents:
34145
diff
changeset
|
1145 | purple_signal_emit(pidgin_accounts_get_handle(), "account-modified", account); |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1146 | } |
|
11739
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11733
diff
changeset
|
1147 | |
|
11987
a6eb4a3f1136
[gaim-migrate @ 14280]
Mark Doliner <markdoliner@pidgin.im>
parents:
11986
diff
changeset
|
1148 | /* If this is a new account, then sign on! */ |
|
19575
b1829eda1afa
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@pidgin.im>
parents:
19125
diff
changeset
|
1149 | if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->register_button))) { |
|
33055
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1150 | purple_account_set_register_callback(account, account_register_cb, NULL); |
|
19575
b1829eda1afa
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@pidgin.im>
parents:
19125
diff
changeset
|
1151 | purple_account_register(account); |
|
19669
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1152 | } else if (new_acct) { |
| 15884 | 1153 | const PurpleSavedStatus *saved_status; |
| 1154 | ||
| 1155 | saved_status = purple_savedstatus_get_current(); | |
|
12125
c1e55f812ded
[gaim-migrate @ 14425]
Mark Doliner <markdoliner@pidgin.im>
parents:
12123
diff
changeset
|
1156 | if (saved_status != NULL) { |
| 15884 | 1157 | purple_savedstatus_activate_for_account(saved_status, account); |
|
41392
b5c84f55d5d2
Remove the ui parameter from purple_account_[gs]et_enabled
Gary Kramlich <grim@reaperworld.com>
parents:
41389
diff
changeset
|
1158 | purple_account_set_enabled(account, TRUE); |
|
12121
cc63210cdc8b
[gaim-migrate @ 14421]
Daniel Atallah <datallah@pidgin.im>
parents:
12106
diff
changeset
|
1159 | } |
|
11638
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11358
diff
changeset
|
1160 | } |
|
10932
a38fb730e964
[gaim-migrate @ 12711]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10931
diff
changeset
|
1161 | |
| 16889 | 1162 | /* We no longer need the data from the dialog window */ |
| 1163 | account_win_destroy_cb(NULL, NULL, dialog); | |
|
5692
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
1164 | } |
|
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
1165 | |
|
41036
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1166 | static void |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1167 | account_prefs_response_cb(GtkDialog *dialog, gint response_id, gpointer data) { |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1168 | AccountPrefsDialog *window = (AccountPrefsDialog *)data; |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1169 | |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1170 | switch(response_id) { |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1171 | case RESPONSE_ADD: |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1172 | account_prefs_save(window); |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1173 | break; |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1174 | case RESPONSE_CLOSE: |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1175 | account_win_destroy_cb(NULL, NULL, window); |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1176 | break; |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1177 | default: |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1178 | break; |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1179 | } |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1180 | } |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1181 | |
|
41435
c46c43e89f34
Remove the read password lookup from GtkAccountEditor as it's no longer used
Gary Kramlich <grim@reaperworld.com>
parents:
41392
diff
changeset
|
1182 | void |
|
c46c43e89f34
Remove the read password lookup from GtkAccountEditor as it's no longer used
Gary Kramlich <grim@reaperworld.com>
parents:
41392
diff
changeset
|
1183 | pidgin_account_dialog_show(PidginAccountDialogType type, |
|
c46c43e89f34
Remove the read password lookup from GtkAccountEditor as it's no longer used
Gary Kramlich <grim@reaperworld.com>
parents:
41392
diff
changeset
|
1184 | PurpleAccount *account) |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1185 | { |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1186 | AccountPrefsDialog *dialog; |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1187 | GtkWidget *win; |
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1188 | GtkWidget *main_vbox; |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1189 | GtkWidget *vbox; |
|
11008
35900a535c11
[gaim-migrate @ 12868]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
10967
diff
changeset
|
1190 | GtkWidget *notebook; |
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
1191 | GtkWidget *button; |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1192 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1193 | dialog = g_new0(AccountPrefsDialog, 1); |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1194 | |
|
40787
8a5a20a49e9b
Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents:
40765
diff
changeset
|
1195 | if(PURPLE_IS_ACCOUNT(account)) { |
|
8a5a20a49e9b
Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents:
40765
diff
changeset
|
1196 | dialog->protocol_id = g_strdup(purple_account_get_protocol_id(account)); |
|
39465
3b48e07c3625
Fix a leak in Pidgin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39463
diff
changeset
|
1197 | } |
|
3b48e07c3625
Fix a leak in Pidgin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39463
diff
changeset
|
1198 | |
|
3b48e07c3625
Fix a leak in Pidgin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39463
diff
changeset
|
1199 | dialog->account = account; |
|
3b48e07c3625
Fix a leak in Pidgin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39463
diff
changeset
|
1200 | dialog->type = type; |
|
3b48e07c3625
Fix a leak in Pidgin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39463
diff
changeset
|
1201 | dialog->sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
|
40787
8a5a20a49e9b
Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents:
40765
diff
changeset
|
1202 | |
|
8a5a20a49e9b
Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents:
40765
diff
changeset
|
1203 | if(dialog->protocol_id != NULL) { |
|
8a5a20a49e9b
Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents:
40765
diff
changeset
|
1204 | PurpleProtocolManager *manager = purple_protocol_manager_get_default(); |
|
8a5a20a49e9b
Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents:
40765
diff
changeset
|
1205 | |
|
8a5a20a49e9b
Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents:
40765
diff
changeset
|
1206 | dialog->protocol = purple_protocol_manager_find(manager, |
|
8a5a20a49e9b
Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents:
40765
diff
changeset
|
1207 | dialog->protocol_id); |
|
8a5a20a49e9b
Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents:
40765
diff
changeset
|
1208 | } |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
1209 | |
|
40533
b1921b17b683
Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
40496
diff
changeset
|
1210 | dialog->window = win = pidgin_dialog_new((type == PIDGIN_ADD_ACCOUNT_DIALOG) ? _("Add Account") : _("Modify Account"), |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
1211 | 6, "account", FALSE); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1212 | |
|
41036
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1213 | g_signal_connect(win, "delete_event", G_CALLBACK(account_win_destroy_cb), |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1214 | dialog); |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1215 | g_signal_connect(win, "response", G_CALLBACK(account_prefs_response_cb), |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1216 | dialog); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1217 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1218 | /* Setup the vbox */ |
|
41058
18f3ea2e7e6d
Remove pidgin_dialog* helper functions
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41036
diff
changeset
|
1219 | main_vbox = gtk_dialog_get_content_area(GTK_DIALOG(win)); |
|
18f3ea2e7e6d
Remove pidgin_dialog* helper functions
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41036
diff
changeset
|
1220 | gtk_box_set_spacing(GTK_BOX(main_vbox), 6); |
|
26543
2ff0a924a18e
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26475
diff
changeset
|
1221 | |
|
2ff0a924a18e
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26475
diff
changeset
|
1222 | dialog->notebook = notebook = gtk_notebook_new(); |
|
41565
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
1223 | gtk_box_append(GTK_BOX(main_vbox), notebook); |
|
11008
35900a535c11
[gaim-migrate @ 12868]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
10967
diff
changeset
|
1224 | |
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1225 | /* Setup the inner vbox */ |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
1226 | dialog->top_vbox = vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 12); |
|
11008
35900a535c11
[gaim-migrate @ 12868]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
10967
diff
changeset
|
1227 | gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox, |
|
12240
194dc3367706
[gaim-migrate @ 14542]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
12185
diff
changeset
|
1228 | gtk_label_new_with_mnemonic(_("_Basic"))); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1229 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1230 | /* Setup the top frames. */ |
| 5774 | 1231 | add_login_options(dialog, vbox); |
| 1232 | add_user_options(dialog, vbox); | |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
1233 | |
|
23266
4abc3fc944da
Add a mnemonic to "Create this new account on the server".
Will Thompson <resiak@pidgin.im>
parents:
22982
diff
changeset
|
1234 | button = gtk_check_button_new_with_mnemonic( |
|
4abc3fc944da
Add a mnemonic to "Create this new account on the server".
Will Thompson <resiak@pidgin.im>
parents:
22982
diff
changeset
|
1235 | _("Create _this new account on the server")); |
|
41565
2ee402c27fcf
Port gtkaccount to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41531
diff
changeset
|
1236 | gtk_box_append(GTK_BOX(main_vbox), button); |
|
19575
b1829eda1afa
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@pidgin.im>
parents:
19125
diff
changeset
|
1237 | dialog->register_button = button; |
|
33055
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1238 | g_signal_connect(G_OBJECT(dialog->register_button), "toggled", G_CALLBACK(register_button_cb), dialog); |
|
19575
b1829eda1afa
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@pidgin.im>
parents:
19125
diff
changeset
|
1239 | if (dialog->account == NULL) |
|
b1829eda1afa
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@pidgin.im>
parents:
19125
diff
changeset
|
1240 | gtk_widget_set_sensitive(button, FALSE); |
|
b1829eda1afa
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@pidgin.im>
parents:
19125
diff
changeset
|
1241 | |
|
39759
ea1401483849
Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39611
diff
changeset
|
1242 | if (!dialog->protocol || !PURPLE_PROTOCOL_IMPLEMENTS(dialog->protocol, SERVER, register_user)) |
|
19575
b1829eda1afa
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@pidgin.im>
parents:
19125
diff
changeset
|
1243 | gtk_widget_hide(button); |
|
b1829eda1afa
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@pidgin.im>
parents:
19125
diff
changeset
|
1244 | |
|
26543
2ff0a924a18e
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26475
diff
changeset
|
1245 | /* Setup the page with 'Advanced' (protocol options). */ |
|
37038
8832d14d7d0c
Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents:
36928
diff
changeset
|
1246 | add_account_options(dialog); |
|
26543
2ff0a924a18e
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26475
diff
changeset
|
1247 | |
|
41350
2bdf14aaf7a1
Create a PidginProxyOptions widget
Gary Kramlich <grim@reaperworld.com>
parents:
41320
diff
changeset
|
1248 | /* Setup the proxy options page. */ |
|
2bdf14aaf7a1
Create a PidginProxyOptions widget
Gary Kramlich <grim@reaperworld.com>
parents:
41320
diff
changeset
|
1249 | dialog->proxy_options = pidgin_proxy_options_new(); |
|
2bdf14aaf7a1
Create a PidginProxyOptions widget
Gary Kramlich <grim@reaperworld.com>
parents:
41320
diff
changeset
|
1250 | if(PURPLE_IS_ACCOUNT(dialog->account)) { |
|
2bdf14aaf7a1
Create a PidginProxyOptions widget
Gary Kramlich <grim@reaperworld.com>
parents:
41320
diff
changeset
|
1251 | pidgin_proxy_options_set_info(PIDGIN_PROXY_OPTIONS(dialog->proxy_options), |
|
2bdf14aaf7a1
Create a PidginProxyOptions widget
Gary Kramlich <grim@reaperworld.com>
parents:
41320
diff
changeset
|
1252 | purple_account_get_proxy_info(dialog->account)); |
|
2bdf14aaf7a1
Create a PidginProxyOptions widget
Gary Kramlich <grim@reaperworld.com>
parents:
41320
diff
changeset
|
1253 | } |
|
2bdf14aaf7a1
Create a PidginProxyOptions widget
Gary Kramlich <grim@reaperworld.com>
parents:
41320
diff
changeset
|
1254 | gtk_notebook_append_page(GTK_NOTEBOOK(notebook), dialog->proxy_options, |
|
2bdf14aaf7a1
Create a PidginProxyOptions widget
Gary Kramlich <grim@reaperworld.com>
parents:
41320
diff
changeset
|
1255 | gtk_label_new_with_mnemonic(_("Proxy"))); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
1256 | |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1257 | add_voice_options(dialog); |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1258 | |
|
41036
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1259 | /* Buttons */ |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1260 | gtk_dialog_add_button(GTK_DIALOG(win), _("_Cancel"), RESPONSE_CLOSE); |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1261 | dialog->ok_button = gtk_dialog_add_button(GTK_DIALOG(win), |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1262 | (type == PIDGIN_ADD_ACCOUNT_DIALOG) ? _("_Add") : _("_Save"), |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1263 | RESPONSE_ADD); |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1264 | |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1265 | if (dialog->account == NULL) { |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1266 | gtk_widget_set_sensitive(dialog->ok_button, FALSE); |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1267 | } |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1268 | |
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
1269 | /* Show the window. */ |
|
5641
a9d1f7917dd4
[gaim-migrate @ 6054]
Christian Hammond <chipx86@chipx86.com>
parents:
5638
diff
changeset
|
1270 | gtk_widget_show(win); |
|
23277
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
1271 | if (!account) |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
1272 | gtk_widget_grab_focus(dialog->protocol_menu); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1273 | } |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1274 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1275 | /************************************************************************** |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1276 | * Accounts Dialog |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1277 | **************************************************************************/ |
|
41517
5bafe75d3907
Replace the request_add Account UiOp with a new AddContact notification
Gary Kramlich <grim@reaperworld.com>
parents:
41514
diff
changeset
|
1278 | /* This still exists because gtkprivacy calls it to add the privacy ui ops */ |
|
5bafe75d3907
Replace the request_add Account UiOp with a new AddContact notification
Gary Kramlich <grim@reaperworld.com>
parents:
41514
diff
changeset
|
1279 | static PurpleAccountUiOps ui_ops = {}; |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
1280 | |
| 15884 | 1281 | PurpleAccountUiOps * |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
1282 | pidgin_accounts_get_ui_ops(void) |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
1283 | { |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
1284 | return &ui_ops; |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
1285 | } |
| 9609 | 1286 | |
| 1287 | void * | |
|
34585
cc4b9443deb9
Renamed pidgin_account_[init,uninit,get_handle] to pidgin_accounts_[init,uninit,get_handle].
Ankit Vani <a@nevitus.org>
parents:
34145
diff
changeset
|
1288 | pidgin_accounts_get_handle(void) { |
| 9609 | 1289 | static int handle; |
| 1290 | ||
| 1291 | return &handle; | |
| 1292 | } | |
| 1293 | ||
| 1294 | void | |
|
34585
cc4b9443deb9
Renamed pidgin_account_[init,uninit,get_handle] to pidgin_accounts_[init,uninit,get_handle].
Ankit Vani <a@nevitus.org>
parents:
34145
diff
changeset
|
1295 | pidgin_accounts_init(void) |
|
10163
a916c8d1ee5c
[gaim-migrate @ 11249]
Mark Doliner <markdoliner@pidgin.im>
parents:
10159
diff
changeset
|
1296 | { |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16071
diff
changeset
|
1297 | purple_prefs_add_none(PIDGIN_PREFS_ROOT "/accounts"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16071
diff
changeset
|
1298 | purple_prefs_add_none(PIDGIN_PREFS_ROOT "/accounts/dialog"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16071
diff
changeset
|
1299 | purple_prefs_add_int(PIDGIN_PREFS_ROOT "/accounts/dialog/width", 520); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16071
diff
changeset
|
1300 | purple_prefs_add_int(PIDGIN_PREFS_ROOT "/accounts/dialog/height", 321); |
|
41189
b779665790a2
Don't use ~/.face.icon as a default profile picture.
Gary Kramlich <grim@reaperworld.com>
parents:
41167
diff
changeset
|
1301 | |
|
b779665790a2
Don't use ~/.face.icon as a default profile picture.
Gary Kramlich <grim@reaperworld.com>
parents:
41167
diff
changeset
|
1302 | purple_prefs_add_path(PIDGIN_PREFS_ROOT "/accounts/buddyicon", NULL); |
|
10163
a916c8d1ee5c
[gaim-migrate @ 11249]
Mark Doliner <markdoliner@pidgin.im>
parents:
10159
diff
changeset
|
1303 | |
|
34585
cc4b9443deb9
Renamed pidgin_account_[init,uninit,get_handle] to pidgin_accounts_[init,uninit,get_handle].
Ankit Vani <a@nevitus.org>
parents:
34145
diff
changeset
|
1304 | purple_signal_register(pidgin_accounts_get_handle(), "account-modified", |
|
34827
1615d90aa584
Refactored pidgin to use GType instead of PurpleValue
Ankit Vani <a@nevitus.org>
parents:
34708
diff
changeset
|
1305 | purple_marshal_VOID__POINTER, G_TYPE_NONE, 1, |
|
1615d90aa584
Refactored pidgin to use GType instead of PurpleValue
Ankit Vani <a@nevitus.org>
parents:
34708
diff
changeset
|
1306 | PURPLE_TYPE_ACCOUNT); |
| 9609 | 1307 | } |
| 1308 | ||
| 1309 | void | |
|
34585
cc4b9443deb9
Renamed pidgin_account_[init,uninit,get_handle] to pidgin_accounts_[init,uninit,get_handle].
Ankit Vani <a@nevitus.org>
parents:
34145
diff
changeset
|
1310 | pidgin_accounts_uninit(void) |
|
10163
a916c8d1ee5c
[gaim-migrate @ 11249]
Mark Doliner <markdoliner@pidgin.im>
parents:
10159
diff
changeset
|
1311 | { |
|
34585
cc4b9443deb9
Renamed pidgin_account_[init,uninit,get_handle] to pidgin_accounts_[init,uninit,get_handle].
Ankit Vani <a@nevitus.org>
parents:
34145
diff
changeset
|
1312 | purple_signals_disconnect_by_handle(pidgin_accounts_get_handle()); |
|
cc4b9443deb9
Renamed pidgin_account_[init,uninit,get_handle] to pidgin_accounts_[init,uninit,get_handle].
Ankit Vani <a@nevitus.org>
parents:
34145
diff
changeset
|
1313 | purple_signals_unregister_by_instance(pidgin_accounts_get_handle()); |
| 9609 | 1314 | } |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1315 |