comparison src/gtkconn.c @ 6109:0922bb7a7bbc

[gaim-migrate @ 6571] Make attempting to sign on to an account twice not crash Gaim, and make the prompt for password request window only open once at max. I might change this in a few minutes, but this works, and I wanted to commit it before I break something. Move the gaim_request_input() call for "Please enter your password" to connection.c instead of gtkconn.c. There is no need for this to be in gtkconn.c, and doing it in core means less work for UIs. Make closing a notify window call the cancel action. Set the titles for request windows, when given. Remove a bit of odd, un-needed code from main.c (hitting "enter" in the password field was calling doenter which called dologin. Now it just calls dologin). committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 13 Jul 2003 18:33:25 +0000
parents 99f4bbeb27bc
children 3c70f8be8558
comparison
equal deleted inserted replaced
6108:edbd278822a0 6109:0922bb7a7bbc
23 #include "account.h" 23 #include "account.h"
24 #include "debug.h" 24 #include "debug.h"
25 #include "util.h" 25 #include "util.h"
26 26
27 #include "gtkblist.h" 27 #include "gtkblist.h"
28 #include "gtkrequest.h"
29 #include "gtkutils.h" 28 #include "gtkutils.h"
30 29
31 #include "ui.h" 30 #include "ui.h"
32 31
33 struct signon_meter { 32 struct signon_meter {
236 235
237 if(meter) 236 if(meter)
238 kill_meter(meter, _("Done.")); 237 kill_meter(meter, _("Done."));
239 } 238 }
240 239
241 static void request_pass_ok_cb(GaimConnection *gc, const char *entry)
242 {
243 GaimAccount *account = gaim_connection_get_account(gc);
244
245 gaim_account_set_password(account, (*entry != '\0') ? entry : NULL);
246
247 gaim_connection_connect(gc);
248 }
249
250 static void request_pass_cancel_cb(GaimConnection *gc, const char *entry)
251 {
252 gaim_connection_destroy(gc);
253 }
254
255 static void gaim_gtk_connection_request_pass(GaimConnection *gc)
256 {
257 gaim_request_input(gc, NULL, _("Enter your password."), NULL,
258 NULL, FALSE, TRUE,
259 _("OK"), G_CALLBACK(request_pass_ok_cb),
260 _("Cancel"), G_CALLBACK(request_pass_cancel_cb), gc);
261 }
262
263 static void gaim_gtk_connection_disconnected(GaimConnection *gc, 240 static void gaim_gtk_connection_disconnected(GaimConnection *gc,
264 const char *reason) 241 const char *reason)
265 { 242 {
266 struct signon_meter *meter = find_signon_meter(gc); 243 struct signon_meter *meter = find_signon_meter(gc);
267 244
289 266
290 static GaimConnectionUiOps conn_ui_ops = 267 static GaimConnectionUiOps conn_ui_ops =
291 { 268 {
292 gaim_gtk_connection_connect_progress, 269 gaim_gtk_connection_connect_progress,
293 gaim_gtk_connection_connected, 270 gaim_gtk_connection_connected,
294 gaim_gtk_connection_request_pass,
295 gaim_gtk_connection_disconnected, 271 gaim_gtk_connection_disconnected,
296 gaim_gtk_connection_notice 272 gaim_gtk_connection_notice
297 }; 273 };
298 274
299 GaimConnectionUiOps *gaim_get_gtk_connection_ui_ops(void) 275 GaimConnectionUiOps *gaim_get_gtk_connection_ui_ops(void)