Thu, 30 Nov 2023 21:33:32 -0600
Remove all of the existing status widgets
None of these work with the new presence system and were going to be removed
sooner or later. I'm opting for sooner as many of them have deprecation
warnings that make the build output difficult to read.
Testing Done:
Ran `ninja turtles` and ran pidgin3 without issues.
Reviewed at https://reviews.imfreedom.org/r/2809/
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
20137
diff
changeset
|
1 | /* pidgin |
| 9709 | 2 | * |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15906
diff
changeset
|
3 | * Pidgin is the legal property of its developers, whose names are too numerous |
| 9709 | 4 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 5 | * source distribution. | |
| 6 | * | |
| 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:
19693
diff
changeset
|
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 9709 | 20 | */ |
|
24569
5dbd0617a27d
Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents:
24541
diff
changeset
|
21 | |
|
42410
563e7a17c220
Fix possible clash of config headers
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42365
diff
changeset
|
22 | #include <purpleconfig.h> |
|
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:
40360
diff
changeset
|
23 | |
|
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:
40360
diff
changeset
|
24 | #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:
40360
diff
changeset
|
25 | |
|
40523
9bcf96663cb9
Make gstreamer-1.0 a required dependency
Gary Kramlich <grim@reaperworld.com>
parents:
40496
diff
changeset
|
26 | #include <gst/gst.h> |
|
9bcf96663cb9
Make gstreamer-1.0 a required dependency
Gary Kramlich <grim@reaperworld.com>
parents:
40496
diff
changeset
|
27 | |
|
40360
e21f3bbcc2a5
Update all of the pidgin code to include purple.h
Gary Kramlich <grim@reaperworld.com>
parents:
40240
diff
changeset
|
28 | #include <purple.h> |
| 9709 | 29 | |
|
12232
857f087ec86b
[gaim-migrate @ 14534]
Richard Laager <rlaager@pidgin.im>
parents:
12122
diff
changeset
|
30 | #include "gtkblist.h" |
|
42347
d768e30362a4
Fix some random include issues
Gary Kramlich <grim@reaperworld.com>
parents:
42342
diff
changeset
|
31 | #include "gtkconv.h" |
| 9709 | 32 | #include "gtkdialogs.h" |
| 33 | #include "gtkutils.h" | |
|
40496
6941fece679b
phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents:
40490
diff
changeset
|
34 | #include "pidgincore.h" |
| 9709 | 35 | |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
36 | static void |
|
42128
118067ca0367
Convert PurpleRequestPage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42127
diff
changeset
|
37 | pidgin_dialogs_im_cb(G_GNUC_UNUSED gpointer data, PurpleRequestPage *page) { |
| 15884 | 38 | PurpleAccount *account; |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
39 | const char *username; |
| 9709 | 40 | |
|
42128
118067ca0367
Convert PurpleRequestPage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42127
diff
changeset
|
41 | account = purple_request_page_get_account(page, "account"); |
|
118067ca0367
Convert PurpleRequestPage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42127
diff
changeset
|
42 | username = purple_request_page_get_string(page, "screenname"); |
| 9709 | 43 | |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
44 | pidgin_dialogs_im_with_user(account, username); |
| 9709 | 45 | } |
| 46 | ||
|
33213
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
47 | static gboolean |
|
42159
1a481edc6307
Fix new request warning in New IM dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42149
diff
changeset
|
48 | pidgin_dialogs_im_name_validator(PurpleRequestField *field, char **errmsg, |
|
1a481edc6307
Fix new request warning in New IM dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42149
diff
changeset
|
49 | gpointer data) |
|
33213
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
50 | { |
|
42159
1a481edc6307
Fix new request warning in New IM dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42149
diff
changeset
|
51 | PurpleRequestFieldAccount *account_field = data; |
|
33213
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
52 | PurpleAccount *account; |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
53 | PurpleProtocol *protocol; |
|
33213
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
54 | const char *username; |
|
40240
4adf32217c85
Fix a warning when opening the new IM dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
55 | gboolean valid = FALSE; |
|
33213
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
56 | |
|
42159
1a481edc6307
Fix new request warning in New IM dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42149
diff
changeset
|
57 | account = purple_request_field_account_get_value(account_field); |
|
40803
0e11ce1049b2
Port Pidgin from purple_protocols to PurpleProtocolManager
Gary Kramlich <grim@reaperworld.com>
parents:
40533
diff
changeset
|
58 | protocol = purple_account_get_protocol(account); |
|
42159
1a481edc6307
Fix new request warning in New IM dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42149
diff
changeset
|
59 | username = purple_request_field_string_get_value(PURPLE_REQUEST_FIELD_STRING(field)); |
|
33213
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
60 | |
|
40240
4adf32217c85
Fix a warning when opening the new IM dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
61 | if (username) { |
|
4adf32217c85
Fix a warning when opening the new IM dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
62 | valid = purple_validate(protocol, username); |
|
4adf32217c85
Fix a warning when opening the new IM dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
63 | } |
|
33219
06b19630bdb0
Validation for Request API fixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33213
diff
changeset
|
64 | |
|
06b19630bdb0
Validation for Request API fixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33213
diff
changeset
|
65 | if (errmsg && !valid) |
|
06b19630bdb0
Validation for Request API fixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33213
diff
changeset
|
66 | *errmsg = g_strdup(_("Invalid username")); |
|
06b19630bdb0
Validation for Request API fixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33213
diff
changeset
|
67 | |
|
06b19630bdb0
Validation for Request API fixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33213
diff
changeset
|
68 | return valid; |
|
33213
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
69 | } |
|
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
70 | |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
71 | void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
72 | pidgin_dialogs_im(void) |
| 9709 | 73 | { |
|
42128
118067ca0367
Convert PurpleRequestPage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42127
diff
changeset
|
74 | PurpleRequestPage *page; |
|
42127
18acb99a0fa6
Convert PurpleRequestGroup into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41947
diff
changeset
|
75 | PurpleRequestGroup *group; |
|
42159
1a481edc6307
Fix new request warning in New IM dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42149
diff
changeset
|
76 | PurpleRequestField *username_field = NULL; |
|
1a481edc6307
Fix new request warning in New IM dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42149
diff
changeset
|
77 | PurpleRequestField *account_field = NULL; |
| 9709 | 78 | |
|
42128
118067ca0367
Convert PurpleRequestPage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42127
diff
changeset
|
79 | page = purple_request_page_new(); |
| 9709 | 80 | |
|
42127
18acb99a0fa6
Convert PurpleRequestGroup into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41947
diff
changeset
|
81 | group = purple_request_group_new(NULL); |
|
42128
118067ca0367
Convert PurpleRequestPage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42127
diff
changeset
|
82 | purple_request_page_add_group(page, group); |
| 9709 | 83 | |
|
42159
1a481edc6307
Fix new request warning in New IM dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42149
diff
changeset
|
84 | account_field = purple_request_field_account_new("account", _("_Account"), |
|
1a481edc6307
Fix new request warning in New IM dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42149
diff
changeset
|
85 | NULL); |
|
1a481edc6307
Fix new request warning in New IM dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42149
diff
changeset
|
86 | purple_request_field_set_type_hint(account_field, "account"); |
|
1a481edc6307
Fix new request warning in New IM dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42149
diff
changeset
|
87 | purple_request_field_set_visible(account_field, |
| 15884 | 88 | (purple_connections_get_all() != NULL && |
| 89 | purple_connections_get_all()->next != NULL)); | |
|
42159
1a481edc6307
Fix new request warning in New IM dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42149
diff
changeset
|
90 | purple_request_field_set_required(account_field, TRUE); |
|
1a481edc6307
Fix new request warning in New IM dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42149
diff
changeset
|
91 | purple_request_group_add_field(group, account_field); |
|
1a481edc6307
Fix new request warning in New IM dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42149
diff
changeset
|
92 | |
|
1a481edc6307
Fix new request warning in New IM dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42149
diff
changeset
|
93 | purple_request_field_set_validator(username_field, |
|
1a481edc6307
Fix new request warning in New IM dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42149
diff
changeset
|
94 | pidgin_dialogs_im_name_validator, |
|
1a481edc6307
Fix new request warning in New IM dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42149
diff
changeset
|
95 | account_field, NULL); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
96 | |
|
42365
45ce6d3f6386
Create PidginAccountRow which subclasses AdwRow
Gary Kramlich <grim@reaperworld.com>
parents:
42357
diff
changeset
|
97 | username_field = purple_request_field_string_new("screenname", _("_Name"), |
|
45ce6d3f6386
Create PidginAccountRow which subclasses AdwRow
Gary Kramlich <grim@reaperworld.com>
parents:
42357
diff
changeset
|
98 | NULL, FALSE); |
|
45ce6d3f6386
Create PidginAccountRow which subclasses AdwRow
Gary Kramlich <grim@reaperworld.com>
parents:
42357
diff
changeset
|
99 | purple_request_field_set_type_hint(username_field, "screenname"); |
|
45ce6d3f6386
Create PidginAccountRow which subclasses AdwRow
Gary Kramlich <grim@reaperworld.com>
parents:
42357
diff
changeset
|
100 | purple_request_field_set_required(username_field, TRUE); |
|
45ce6d3f6386
Create PidginAccountRow which subclasses AdwRow
Gary Kramlich <grim@reaperworld.com>
parents:
42357
diff
changeset
|
101 | purple_request_group_add_field(group, username_field); |
|
45ce6d3f6386
Create PidginAccountRow which subclasses AdwRow
Gary Kramlich <grim@reaperworld.com>
parents:
42357
diff
changeset
|
102 | |
|
39665
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
103 | purple_request_fields( |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
104 | purple_blist_get_default(), _("New Instant Message"), NULL, |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
105 | _("Please enter the username or alias of the person " |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
106 | "you would like to IM."), |
|
42128
118067ca0367
Convert PurpleRequestPage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42127
diff
changeset
|
107 | page, _("OK"), G_CALLBACK(pidgin_dialogs_im_cb), _("Cancel"), |
|
39665
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
108 | NULL, NULL, NULL); |
| 9709 | 109 | } |
| 110 | ||
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
111 | void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
112 | pidgin_dialogs_im_with_user(PurpleAccount *account, const char *username) |
| 9709 | 113 | { |
|
40885
87f6241da196
Update purple_conversations_find_* to return PurpleConversations instead of subclasses
Gary Kramlich <grim@reaperworld.com>
parents:
40803
diff
changeset
|
114 | PurpleConversation *im; |
|
40952
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40885
diff
changeset
|
115 | PurpleConversationManager *manager; |
| 9709 | 116 | |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
117 | g_return_if_fail(account != NULL); |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
118 | g_return_if_fail(username != NULL); |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
119 | |
|
40952
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40885
diff
changeset
|
120 | manager = purple_conversation_manager_get_default(); |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40885
diff
changeset
|
121 | im = purple_conversation_manager_find_im(manager, account, username); |
| 9709 | 122 | |
|
40952
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40885
diff
changeset
|
123 | if(!PURPLE_IS_IM_CONVERSATION(im)) { |
|
42449
bde60654600e
Remove a whole bunch of dead code from gtkconv.c
Gary Kramlich <grim@reaperworld.com>
parents:
42410
diff
changeset
|
124 | /* This constructor automagically registers the conversation with the |
|
bde60654600e
Remove a whole bunch of dead code from gtkconv.c
Gary Kramlich <grim@reaperworld.com>
parents:
42410
diff
changeset
|
125 | * manager. |
|
bde60654600e
Remove a whole bunch of dead code from gtkconv.c
Gary Kramlich <grim@reaperworld.com>
parents:
42410
diff
changeset
|
126 | */ |
|
bde60654600e
Remove a whole bunch of dead code from gtkconv.c
Gary Kramlich <grim@reaperworld.com>
parents:
42410
diff
changeset
|
127 | purple_im_conversation_new(account, username); |
|
40952
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40885
diff
changeset
|
128 | } |
| 9709 | 129 | } |
| 130 | ||
| 131 | static void | |
|
42128
118067ca0367
Convert PurpleRequestPage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42127
diff
changeset
|
132 | pidgin_dialogs_info_cb(G_GNUC_UNUSED gpointer data, PurpleRequestPage *page) { |
| 9709 | 133 | char *username; |
| 15884 | 134 | PurpleAccount *account; |
|
41529
0e835d051f5c
Update gtkdialogs.c for GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41106
diff
changeset
|
135 | const gchar *screenname = NULL; |
| 9709 | 136 | |
|
42128
118067ca0367
Convert PurpleRequestPage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42127
diff
changeset
|
137 | account = purple_request_page_get_account(page, "account"); |
| 9709 | 138 | |
|
42128
118067ca0367
Convert PurpleRequestPage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42127
diff
changeset
|
139 | screenname = purple_request_page_get_string(page, "screenname"); |
|
41529
0e835d051f5c
Update gtkdialogs.c for GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41106
diff
changeset
|
140 | username = g_strdup(purple_normalize(account, screenname)); |
| 9709 | 141 | |
|
41529
0e835d051f5c
Update gtkdialogs.c for GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41106
diff
changeset
|
142 | if(username != NULL && *username != '\0' && account != NULL) { |
|
0e835d051f5c
Update gtkdialogs.c for GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41106
diff
changeset
|
143 | pidgin_retrieve_user_info(purple_account_get_connection(account), |
|
0e835d051f5c
Update gtkdialogs.c for GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41106
diff
changeset
|
144 | username); |
|
40125
a7acc7b00d79
Replace purple_str_has_{prefix,suffix} by g_str_has_{prefix,suffix}.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40064
diff
changeset
|
145 | } |
| 9709 | 146 | |
| 147 | g_free(username); | |
| 148 | } | |
| 149 | ||
| 150 | void | |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
151 | pidgin_dialogs_info(void) |
| 9709 | 152 | { |
|
42128
118067ca0367
Convert PurpleRequestPage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42127
diff
changeset
|
153 | PurpleRequestPage *page; |
|
42127
18acb99a0fa6
Convert PurpleRequestGroup into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41947
diff
changeset
|
154 | PurpleRequestGroup *group; |
| 15884 | 155 | PurpleRequestField *field; |
| 9709 | 156 | |
|
42128
118067ca0367
Convert PurpleRequestPage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42127
diff
changeset
|
157 | page = purple_request_page_new(); |
| 9709 | 158 | |
|
42127
18acb99a0fa6
Convert PurpleRequestGroup into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41947
diff
changeset
|
159 | group = purple_request_group_new(NULL); |
|
42128
118067ca0367
Convert PurpleRequestPage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42127
diff
changeset
|
160 | purple_request_page_add_group(page, group); |
| 9709 | 161 | |
| 15884 | 162 | field = purple_request_field_account_new("account", _("_Account"), NULL); |
| 163 | purple_request_field_set_type_hint(field, "account"); | |
| 164 | purple_request_field_set_visible(field, | |
| 165 | (purple_connections_get_all() != NULL && | |
| 166 | purple_connections_get_all()->next != NULL)); | |
| 167 | purple_request_field_set_required(field, TRUE); | |
|
42127
18acb99a0fa6
Convert PurpleRequestGroup into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41947
diff
changeset
|
168 | purple_request_group_add_field(group, field); |
| 9709 | 169 | |
|
42365
45ce6d3f6386
Create PidginAccountRow which subclasses AdwRow
Gary Kramlich <grim@reaperworld.com>
parents:
42357
diff
changeset
|
170 | field = purple_request_field_string_new("screenname", _("_Name"), NULL, FALSE); |
|
45ce6d3f6386
Create PidginAccountRow which subclasses AdwRow
Gary Kramlich <grim@reaperworld.com>
parents:
42357
diff
changeset
|
171 | purple_request_field_set_type_hint(field, "screenname"); |
|
45ce6d3f6386
Create PidginAccountRow which subclasses AdwRow
Gary Kramlich <grim@reaperworld.com>
parents:
42357
diff
changeset
|
172 | purple_request_field_set_required(field, TRUE); |
|
45ce6d3f6386
Create PidginAccountRow which subclasses AdwRow
Gary Kramlich <grim@reaperworld.com>
parents:
42357
diff
changeset
|
173 | purple_request_group_add_field(group, field); |
|
45ce6d3f6386
Create PidginAccountRow which subclasses AdwRow
Gary Kramlich <grim@reaperworld.com>
parents:
42357
diff
changeset
|
174 | |
|
39665
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
175 | purple_request_fields( |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
176 | purple_blist_get_default(), _("Get User Info"), NULL, |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
177 | _("Please enter the username or alias of the person " |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
178 | "whose info you would like to view."), |
|
42128
118067ca0367
Convert PurpleRequestPage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42127
diff
changeset
|
179 | page, _("OK"), G_CALLBACK(pidgin_dialogs_info_cb), |
|
39665
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
180 | _("Cancel"), NULL, NULL, NULL); |
| 9709 | 181 | } |
| 182 | ||
| 183 | static void | |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
184 | pidgin_dialogs_alias_buddy_cb(PurpleBuddy *buddy, const char *new_alias) |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
185 | { |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34726
diff
changeset
|
186 | purple_buddy_set_local_alias(buddy, new_alias); |
|
35499
c4c5e0a670b1
Fix namespaces issues in libpurple.
Ankit Vani <a@nevitus.org>
parents:
35469
diff
changeset
|
187 | purple_serv_alias_buddy(buddy); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
188 | } |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
189 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
190 | void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
191 | pidgin_dialogs_alias_buddy(PurpleBuddy *buddy) |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
192 | { |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
193 | gchar *secondary; |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
194 | |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
195 | g_return_if_fail(buddy != NULL); |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
196 | |
|
32709
0edad3ff7243
Use the PurpleBuddy accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32577
diff
changeset
|
197 | secondary = g_strdup_printf(_("Enter an alias for %s."), purple_buddy_get_name(buddy)); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
198 | |
| 15884 | 199 | purple_request_input(NULL, _("Alias Buddy"), NULL, |
|
34717
b3e588adef5a
Global replace purple_buddy_get_local_buddy_alias() with purple_buddy_get_local_alias()
Ankit Vani <a@nevitus.org>
parents:
34708
diff
changeset
|
200 | secondary, purple_buddy_get_local_alias(buddy), FALSE, FALSE, NULL, |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
201 | _("Alias"), G_CALLBACK(pidgin_dialogs_alias_buddy_cb), |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
202 | _("Cancel"), NULL, |
|
34329
ddbc1337332c
Request API refactoring: introduce PurpleRequestCommonParameters and switch purple_request_input to it
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34301
diff
changeset
|
203 | purple_request_cpar_from_account(purple_buddy_get_account(buddy)), |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
204 | buddy); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
205 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
206 | g_free(secondary); |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
207 | } |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
208 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
209 | static void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
210 | pidgin_dialogs_alias_chat_cb(PurpleChat *chat, const char *new_alias) |
| 9709 | 211 | { |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34726
diff
changeset
|
212 | purple_chat_set_alias(chat, new_alias); |
| 9709 | 213 | } |
| 214 | ||
| 215 | void | |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
216 | pidgin_dialogs_alias_chat(PurpleChat *chat) |
| 9709 | 217 | { |
|
34739
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
218 | gchar *alias; |
|
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
219 | |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
220 | g_return_if_fail(chat != NULL); |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
221 | |
|
34739
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
222 | g_object_get(chat, "alias", &alias, NULL); |
|
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
223 | |
| 15884 | 224 | purple_request_input(NULL, _("Alias Chat"), NULL, |
| 9709 | 225 | _("Enter an alias for this chat."), |
|
34739
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
226 | alias, FALSE, FALSE, NULL, |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
227 | _("Alias"), G_CALLBACK(pidgin_dialogs_alias_chat_cb), |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
228 | _("Cancel"), NULL, |
|
34329
ddbc1337332c
Request API refactoring: introduce PurpleRequestCommonParameters and switch purple_request_input to it
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34301
diff
changeset
|
229 | purple_request_cpar_from_account(purple_chat_get_account(chat)), |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
230 | chat); |
|
34923
416a7736a401
Unref and free everything recieved from g_object_get
Ankit Vani <a@nevitus.org>
parents:
34887
diff
changeset
|
231 | |
|
416a7736a401
Unref and free everything recieved from g_object_get
Ankit Vani <a@nevitus.org>
parents:
34887
diff
changeset
|
232 | g_free(alias); |
| 9709 | 233 | } |
| 234 |