From: Christian Dywan Date: Sun, 11 Jan 2009 20:16:02 +0000 (+0100) Subject: Show a dialog if Midori is running but not responding X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e23ed6234e64d765aa7fd0aee06236fc330911b4;p=midori Show a dialog if Midori is running but not responding --- 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; }