Mercurial > pidgin
comparison src/gtkaccount.c @ 5653:2216abc2d421
[gaim-migrate @ 6067]
Added a function I forgot.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Mon, 02 Jun 2003 06:39:09 +0000 |
parents | 20ce7928c0b9 |
children | 160dfd3b0679 |
comparison
equal
deleted
inserted
replaced
5652:4fa26acb4cd3 | 5653:2216abc2d421 |
---|---|
129 static void | 129 static void |
130 __add_login_options(AccountPrefsDialog *dialog, GtkWidget *parent) | 130 __add_login_options(AccountPrefsDialog *dialog, GtkWidget *parent) |
131 { | 131 { |
132 GtkWidget *frame; | 132 GtkWidget *frame; |
133 GtkWidget *vbox; | 133 GtkWidget *vbox; |
134 GtkWidget *entry; | |
135 GaimPlugin *plugin = NULL; | |
134 GaimProtocol protocol; | 136 GaimProtocol protocol; |
137 GList *user_splits; | |
138 GList *split_entries = NULL; | |
139 GList *l, *l2; | |
140 char *username; | |
135 | 141 |
136 if (dialog->login_frame != NULL) | 142 if (dialog->login_frame != NULL) |
137 gtk_widget_destroy(dialog->login_frame); | 143 gtk_widget_destroy(dialog->login_frame); |
138 | 144 |
139 if (dialog->account == NULL) | 145 if (dialog->account == NULL) |
140 protocol = GAIM_PROTO_OSCAR; | 146 protocol = GAIM_PROTO_OSCAR; |
141 else | 147 else |
142 protocol = gaim_account_get_protocol(dialog->account); | 148 protocol = gaim_account_get_protocol(dialog->account); |
143 | 149 |
150 plugin = gaim_find_prpl(protocol); | |
151 | |
152 | |
153 /* Build the login options frame. */ | |
144 frame = gaim_gtk_make_frame(parent, _("Login Options")); | 154 frame = gaim_gtk_make_frame(parent, _("Login Options")); |
145 | 155 |
146 /* cringe */ | 156 /* cringe */ |
147 dialog->login_frame = gtk_widget_get_parent(gtk_widget_get_parent(frame)); | 157 dialog->login_frame = gtk_widget_get_parent(gtk_widget_get_parent(frame)); |
148 | 158 |
166 gtk_entry_set_text(GTK_ENTRY(dialog->screenname_entry), | 176 gtk_entry_set_text(GTK_ENTRY(dialog->screenname_entry), |
167 gaim_account_get_username(dialog->account)); | 177 gaim_account_get_username(dialog->account)); |
168 | 178 |
169 __add_pref_box(dialog, vbox, _("Screenname:"), dialog->screenname_entry); | 179 __add_pref_box(dialog, vbox, _("Screenname:"), dialog->screenname_entry); |
170 | 180 |
171 #if 0 | 181 /* Do the user split thang */ |
172 if (dialog->user_splits != NULL) { | 182 if (plugin == NULL) /* Yeah right. */ |
173 g_list_free(dialog->user_splits); | 183 user_splits = NULL; |
174 dialog->user_splits = NULL; | 184 else |
185 user_splits = GAIM_PLUGIN_PROTOCOL_INFO(plugin)->user_splits; | |
186 | |
187 if (dialog->account != NULL) | |
188 username = g_strdup(gaim_account_get_username(dialog->account)); | |
189 | |
190 for (l = user_splits; l != NULL; l = l->next) { | |
191 char *buf; | |
192 | |
193 buf = g_strdup_printf("%s:", gaim_account_user_split_get_text(buf)); | |
194 | |
195 entry = gtk_entry_new(); | |
196 | |
197 __add_pref_box(dialog, vbox, buf, entry); | |
198 | |
199 g_free(buf); | |
200 | |
201 split_entries = g_list_append(split_entries, entry); | |
175 } | 202 } |
176 #endif | 203 |
204 for (l = g_list_last(split_entries), l2 = g_list_last(user_splits); | |
205 l != NULL && l2 != NULL; | |
206 l = l->prev, l2 = l2->prev) { | |
207 | |
208 GaimAccountUserSplit *split = l2->data; | |
209 GtkWidget *entry = l->data; | |
210 char *value; | |
211 char *c; | |
212 | |
213 if (dialog->account == NULL) | |
214 value = gaim_account_user_split_get_default_value(split); | |
215 else { | |
216 c = strrchr(username, gaim_account_user_split_get_sep(split)); | |
217 | |
218 if (c != NULL) { | |
219 *c = '\0'; | |
220 c++; | |
221 | |
222 value = c; | |
223 } | |
224 } | |
225 | |
226 gtk_entry_set_text(GTK_ENTRY(entry), value); | |
227 } | |
228 | |
229 g_list_free(split_entries); | |
177 } | 230 } |
178 | 231 |
179 static void | 232 static void |
180 __show_account_prefs(AccountPrefsDialogType type, GaimAccount *account) | 233 __show_account_prefs(AccountPrefsDialogType type, GaimAccount *account) |
181 { | 234 { |