comparison pidgin/gtkmain.c @ 32779:d72f2f13b60f

merge of 'c8c73eea7431e6f940916315ace40a41c8da3faa' and 'fec428131bde0ae8247941bd6a3d996c984c9189'
author Ethan Blanton <elb@pidgin.im>
date Fri, 21 Oct 2011 14:36:18 +0000
parents 142429bcb4c8
children
comparison
equal deleted inserted replaced
32778:14787acaf9d7 32779:d72f2f13b60f
496 GError *error; 496 GError *error;
497 #endif 497 #endif
498 int opt; 498 int opt;
499 gboolean gui_check; 499 gboolean gui_check;
500 gboolean debug_enabled; 500 gboolean debug_enabled;
501 gboolean migration_failed = FALSE;
502 GList *active_accounts; 501 GList *active_accounts;
503 struct stat st; 502 struct stat st;
504 503
505 struct option long_options[] = { 504 struct option long_options[] = {
506 {"config", required_argument, NULL, 'c'}, 505 {"config", required_argument, NULL, 'c'},
728 * Fire up this baby. 727 * Fire up this baby.
729 */ 728 */
730 729
731 purple_debug_set_enabled(debug_enabled); 730 purple_debug_set_enabled(debug_enabled);
732 731
733 /* If we're using a custom configuration directory, we
734 * do NOT want to migrate, or weird things will happen. */
735 if (opt_config_dir_arg == NULL)
736 {
737 if (!purple_core_migrate())
738 {
739 migration_failed = TRUE;
740 }
741 }
742
743 search_path = g_build_filename(purple_user_dir(), "gtkrc-2.0", NULL); 732 search_path = g_build_filename(purple_user_dir(), "gtkrc-2.0", NULL);
744 gtk_rc_add_default_file(search_path); 733 gtk_rc_add_default_file(search_path);
745 g_free(search_path); 734 g_free(search_path);
746 735
747 gui_check = gtk_init_check(&argc, &argv); 736 gui_check = gtk_init_check(&argc, &argv);
762 g_set_application_name(PIDGIN_NAME); 751 g_set_application_name(PIDGIN_NAME);
763 752
764 #ifdef _WIN32 753 #ifdef _WIN32
765 winpidgin_init(hint); 754 winpidgin_init(hint);
766 #endif 755 #endif
767
768 if (migration_failed)
769 {
770 char *old = g_strconcat(purple_home_dir(),
771 G_DIR_SEPARATOR_S ".gaim", NULL);
772 const char *text = _(
773 "%s encountered errors migrating your settings "
774 "from %s to %s. Please investigate and complete the "
775 "migration by hand. Please report this error at http://developer.pidgin.im");
776 GtkWidget *dialog;
777
778 dialog = gtk_message_dialog_new(NULL,
779 0,
780 GTK_MESSAGE_ERROR,
781 GTK_BUTTONS_CLOSE,
782 text, PIDGIN_NAME,
783 old, purple_user_dir());
784 g_free(old);
785
786 g_signal_connect_swapped(dialog, "response",
787 G_CALLBACK(gtk_main_quit), NULL);
788
789 gtk_widget_show_all(dialog);
790
791 gtk_main();
792
793 #ifdef HAVE_SIGNAL_H
794 g_free(segfault_message);
795 #endif
796 return 0;
797 }
798 756
799 purple_core_set_ui_ops(pidgin_core_get_ui_ops()); 757 purple_core_set_ui_ops(pidgin_core_get_ui_ops());
800 purple_eventloop_set_ui_ops(pidgin_eventloop_get_ui_ops()); 758 purple_eventloop_set_ui_ops(pidgin_eventloop_get_ui_ops());
801 759
802 /* 760 /*