From 7ff0e0214e0c3c4f27d7042b5d2b6ec04814c59b Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 5 Nov 2014 19:27:43 +0800 Subject: [PATCH] linux: Use GTK+ for error reporting when GUI is ready --- atom/browser/ui/message_box_views.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/atom/browser/ui/message_box_views.cc b/atom/browser/ui/message_box_views.cc index ff27373d..959545c2 100644 --- a/atom/browser/ui/message_box_views.cc +++ b/atom/browser/ui/message_box_views.cc @@ -370,6 +370,14 @@ void ShowErrorBox(const base::string16& title, const base::string16& content) { ui::MessageBox(NULL, content, title, MB_OK | MB_ICONERROR | MB_TASKMODAL); #elif defined(USE_X11) if (Browser::Get()->is_ready()) { + GtkWidget* dialog = gtk_message_dialog_new( + NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, + "%s", base::UTF16ToUTF8(title).c_str()); + gtk_message_dialog_format_secondary_text( + GTK_MESSAGE_DIALOG(dialog), + "%s", base::UTF16ToUTF8(content).c_str()); + gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); } else { fprintf(stderr, ANSI_TEXT_BOLD ANSI_BACKGROUND_GRAY -- 2.43.0