src/gtkmain.c

changeset 10738
63ca8277c234
parent 10638
51f38280c21c
child 10819
b21062d5584a
equal deleted inserted replaced
10737:c7759d698996 10738:63ca8277c234
112 names = g_strsplit(name, ",", 64); 112 names = g_strsplit(name, ",", 64);
113 for (i = 0; names[i] != NULL; i++) { 113 for (i = 0; names[i] != NULL; i++) {
114 account = gaim_accounts_find(names[i], NULL); 114 account = gaim_accounts_find(names[i], NULL);
115 if (account != NULL) { /* found a user */ 115 if (account != NULL) { /* found a user */
116 ret = 0; 116 ret = 0;
117 gaim_account_connect(account, gaim_account_get_status(account, "online")); 117 gaim_account_connect(account);
118 } 118 }
119 } 119 }
120 g_strfreev(names); 120 g_strfreev(names);
121 } else { /* no name given, use the first account */ 121 } else { /* no name given, use the first account */
122 account = (GaimAccount *)gaim_accounts_get_all()->data; 122 account = (GaimAccount *)gaim_accounts_get_all()->data;
123 ret = 0; 123 ret = 0;
124 gaim_account_connect(account, gaim_account_get_status(account, "online")); 124 gaim_account_connect(account);
125 } 125 }
126 126
127 return ret; 127 return ret;
128 } 128 }
129 129
454 void (*prev_sig_disp)(); 454 void (*prev_sig_disp)();
455 #endif 455 #endif
456 int opt; 456 int opt;
457 gboolean gui_check; 457 gboolean gui_check;
458 gboolean debug_enabled; 458 gboolean debug_enabled;
459 gchar *gaimrc, *accountsxml;
460 #if HAVE_SIGNAL_H 459 #if HAVE_SIGNAL_H
461 char errmsg[BUFSIZ]; 460 char errmsg[BUFSIZ];
462 #endif 461 #endif
463 462
464 struct option long_options[] = { 463 struct option long_options[] = {
622 "Initialization of the Gaim core failed. Dumping core.\n" 621 "Initialization of the Gaim core failed. Dumping core.\n"
623 "Please report this!\n"); 622 "Please report this!\n");
624 abort(); 623 abort();
625 } 624 }
626 625
627 /* TODO: Remove this check. Maybe in 2005. --KingAnt, 25 Jul 2004 */
628 gaimrc = g_build_filename(gaim_home_dir(), ".gaimrc", NULL);
629 accountsxml = g_build_filename(gaim_user_dir(), "accounts.xml", NULL);
630 if (g_file_test(gaimrc, G_FILE_TEST_EXISTS) &&
631 !g_file_test(accountsxml, G_FILE_TEST_EXISTS))
632 {
633 gaim_notify_error(NULL, NULL, _("Unable to load preferences"),
634 _("Gaim was not able to load your preferences "
635 "because they are stored in an old format "
636 "that is no longer used. Please reconfigure "
637 "your settings using the Preferences window."));
638 }
639 g_free(gaimrc);
640 g_free(accountsxml);
641
642 /* TODO: Move blist loading into gaim_blist_init() */ 626 /* TODO: Move blist loading into gaim_blist_init() */
643 gaim_set_blist(gaim_blist_new()); 627 gaim_set_blist(gaim_blist_new());
644 gaim_blist_load(); 628 gaim_blist_load();
645 629
646 /* TODO: Move prefs loading into gaim_prefs_init() */ 630 /* TODO: Move prefs loading into gaim_prefs_init() */
679 g_free(opt_login_arg); 663 g_free(opt_login_arg);
680 opt_login_arg = NULL; 664 opt_login_arg = NULL;
681 } 665 }
682 } 666 }
683 667
684 if (!opt_acct && !opt_nologin) 668 if (!opt_acct && opt_nologin)
685 gaim_accounts_auto_login(GAIM_GTK_UI); 669 {
670 /* TODO: Need to disable all accounts or set them all to offline */
671 }
686 672
687 if (opt_acct || (gaim_accounts_get_all() == NULL)) { 673 if (opt_acct || (gaim_accounts_get_all() == NULL)) {
688 gaim_gtk_accounts_window_show(); 674 gaim_gtk_accounts_window_show();
689 } 675 }
690 676

mercurial