From e23ed6234e64d765aa7fd0aee06236fc330911b4 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sun, 11 Jan 2009 21:16:02 +0100 Subject: [PATCH] Show a dialog if Midori is running but not responding --- midori/main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/midori/main.c b/midori/main.c index c1d728f9..88ac4b35 100644 --- a/midori/main.c +++ b/midori/main.c @@ -1958,6 +1958,8 @@ main (int argc, after a crash, so running a new window isn't a good idea. */ if (midori_app_instance_is_running (app)) { + GtkWidget* dialog; + /* TODO: Open as many tabs as we have uris, seperated by pipes */ if (uris) result = midori_app_instance_send_uris (app, uris); @@ -1967,8 +1969,12 @@ main (int argc, if (result) return 0; - g_print (_("An instance of Midori is already running but not responding.\n")); - /* FIXME: Show a dialog which allows killing the existing instance */ + dialog = gtk_message_dialog_new (NULL, + 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s", + _("An instance of Midori is already running but not responding.\n")); + if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_DELETE_EVENT) + gtk_widget_destroy (dialog); + /* FIXME: Allow killing the existing instance */ return 1; } -- 2.39.5