pidgin/pidginapplication.c

changeset 41872
b405b4eb38fa
parent 41868
e69cbf7921ec
child 41932
0c3de459b1cc
equal deleted inserted replaced
41871:613d42be784e 41872:b405b4eb38fa
710 n_actions, 710 n_actions,
711 FALSE); 711 FALSE);
712 } 712 }
713 } 713 }
714 714
715 static void
716 pidgin_application_error_reponse_cb(G_GNUC_UNUSED AdwMessageDialog *self,
717 G_GNUC_UNUSED char *response,
718 gpointer data)
719 {
720 g_application_quit(data);
721 }
722
715 /****************************************************************************** 723 /******************************************************************************
716 * GtkApplication Implementation 724 * GtkApplication Implementation
717 *****************************************************************************/ 725 *****************************************************************************/
718 static void 726 static void
719 pidgin_application_window_added(GtkApplication *application, 727 pidgin_application_window_added(GtkApplication *application,
780 #ifdef _WIN32 788 #ifdef _WIN32
781 winpidgin_init(); 789 winpidgin_init();
782 #endif 790 #endif
783 791
784 if(!purple_core_init(pidgin_ui_new(), &error)) { 792 if(!purple_core_init(pidgin_ui_new(), &error)) {
785 fprintf(stderr, 793 GtkWidget *message = NULL;
786 _("Initialization of the libpurple core failed. %s\n" 794 const char *error_message = "unknown error";
787 "Aborting!\nPlease report this!\n"), 795
788 (error != NULL) ? error->message : "unknown error"); 796 if(error != NULL) {
797 error_message = error->message;
798 }
799
800 message = adw_message_dialog_new(NULL,
801 _("Pidgin 3 failed to initialize"),
802 error_message);
789 g_clear_error(&error); 803 g_clear_error(&error);
790 g_abort(); 804
805 adw_message_dialog_add_responses(ADW_MESSAGE_DIALOG(message),
806 "close", _("Close"), NULL);
807 adw_message_dialog_set_close_response(ADW_MESSAGE_DIALOG(message),
808 "close");
809
810 g_signal_connect(message, "response",
811 G_CALLBACK(pidgin_application_error_reponse_cb),
812 application);
813
814 gtk_window_present_with_time(GTK_WINDOW(message), GDK_CURRENT_TIME);
815
816 return;
791 } 817 }
792 818
793 pidgin_application_init_plugins(); 819 pidgin_application_init_plugins();
794 820
795 /* load plugins we had when we quit */ 821 /* load plugins we had when we quit */

mercurial