comparison src/main.c @ 5580:86456ec3ca25

[gaim-migrate @ 5984] More nifty stuff! Accounts now get converted, and other niceties. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sat, 31 May 2003 02:27:03 +0000
parents 5e7de337a053
children 3a9b54f260e3
comparison
equal deleted inserted replaced
5579:e0146fcc4718 5580:86456ec3ca25
230 } 230 }
231 } 231 }
232 } 232 }
233 g_strfreev(names); 233 g_strfreev(names);
234 } else { /* no name given, use default */ 234 } else { /* no name given, use default */
235 account = (GaimAccount *)gaim_accounts->data; 235 account = (GaimAccount *)gaim_accounts_get_all()->data;
236 236
237 if (gaim_account_get_remember_password(account)) { 237 if (gaim_account_get_remember_password(account)) {
238 retval = 0; 238 retval = 0;
239 serv_login(account); 239 serv_login(account);
240 } 240 }
271 } 271 }
272 272
273 273
274 static GList *combo_user_names() 274 static GList *combo_user_names()
275 { 275 {
276 GSList *accts = gaim_accounts; 276 GList *accts = gaim_accounts_get_all();
277 GList *tmp = NULL; 277 GList *tmp = NULL;
278 GaimAccount *account; 278 GaimAccount *account;
279 279
280 if (!accts) 280 if (!accts)
281 return g_list_append(NULL, _("<New User>")); 281 return g_list_append(NULL, _("<New User>"));
392 G_CALLBACK(dologin), mainwindow); 392 G_CALLBACK(dologin), mainwindow);
393 g_signal_connect(G_OBJECT(button), "button-press-event", G_CALLBACK(domiddleclick), NULL); 393 g_signal_connect(G_OBJECT(button), "button-press-event", G_CALLBACK(domiddleclick), NULL);
394 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); 394 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
395 395
396 /* Now grab the focus that we need */ 396 /* Now grab the focus that we need */
397 if (gaim_accounts) { 397 if (gaim_accounts_get_all()) {
398 GaimAccount *account = gaim_accounts->data; 398 GaimAccount *account = gaim_accounts_get_all()->data;
399 399
400 if (gaim_account_get_remember_password(account)) { 400 if (gaim_account_get_remember_password(account)) {
401 combo_changed(NULL, name); 401 combo_changed(NULL, name);
402 gtk_widget_grab_focus(button); 402 gtk_widget_grab_focus(button);
403 } else { 403 } else {
587 { 587 {
588 GaimAccount *account; 588 GaimAccount *account;
589 589
590 account = gaim_account_find(name, -1); 590 account = gaim_account_find(name, -1);
591 591
592 if (!account) { /* new user */ 592 if (account == NULL) /* new user */
593 account = g_new0(GaimAccount, 1); 593 account = gaim_account_new(name, GAIM_PROTO_DEFAULT);
594 g_snprintf(account->username, sizeof(account->username), "%s", name); 594
595 account->protocol = GAIM_PROTO_DEFAULT; 595 /* Place it as the first user. */
596 gaim_accounts = g_slist_prepend(gaim_accounts, account); 596 gaim_accounts_reorder(account, 0);
597 } else { /* user already exists */
598 gaim_accounts = g_slist_remove(gaim_accounts, account);
599 gaim_accounts = g_slist_prepend(gaim_accounts, account);
600 }
601 save_prefs();
602 } 597 }
603 598
604 #ifdef _WIN32 599 #ifdef _WIN32
605 /* WIN32 print and log handlers */ 600 /* WIN32 print and log handlers */
606 601
891 886
892 gaim_prefs_init(); 887 gaim_prefs_init();
893 gaim_gtk_prefs_init(); 888 gaim_gtk_prefs_init();
894 gaim_accounts_load(); 889 gaim_accounts_load();
895 890
896 if (!gaim_prefs_load()) 891 if (!gaim_prefs_load()) {
897 load_prefs(); 892 load_prefs();
893 gaim_prefs_sync();
894 gaim_accounts_sync();
895 }
898 896
899 plugin_search_paths[0] = LIBDIR; 897 plugin_search_paths[0] = LIBDIR;
900 plugin_search_paths[1] = gaim_user_dir(); 898 plugin_search_paths[1] = gaim_user_dir();
901 plugin_search_paths[2] = g_strdup_printf("%s/plugins", gaim_user_dir()); 899 plugin_search_paths[2] = g_strdup_printf("%s/plugins", gaim_user_dir());
902 900