[evolution/gnome-3-8] Notify user about question dialogs
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/gnome-3-8] Notify user about question dialogs
- Date: Mon, 24 Jun 2013 12:53:20 +0000 (UTC)
commit 69976cc0852f4a84288e1b71cc72f101ca17b6b1
Author: Milan Crha <mcrha redhat com>
Date: Mon Jun 24 14:48:00 2013 +0200
Notify user about question dialogs
Set an urgency hint on dialog's parent, or dialog itself, when it has
no parent, to get user's attention to the dialog. For example, when
there is a changed mail composer window on a different workspace than
evolution's main window and user invokes quit by File->Quit in evolution,
then the window is waiting for a response on the composer, but there
was no hint it's waiting for anything.
e-util/e-alert-dialog.c | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/e-util/e-alert-dialog.c b/e-util/e-alert-dialog.c
index b4e12ad..156c272 100644
--- a/e-util/e-alert-dialog.c
+++ b/e-util/e-alert-dialog.c
@@ -322,17 +322,43 @@ e_alert_dialog_new_for_args (GtkWindow *parent,
return dialog;
}
+static gboolean
+dialog_focus_in_event_cb (GtkWindow *dialog,
+ GdkEvent *event,
+ GtkWindow *parent)
+{
+ gtk_window_set_urgency_hint (parent, FALSE);
+
+ return FALSE;
+}
+
gint
e_alert_run_dialog (GtkWindow *parent,
EAlert *alert)
{
GtkWidget *dialog;
gint response;
+ gulong signal_id = 0;
g_return_val_if_fail (E_IS_ALERT (alert), 0);
dialog = e_alert_dialog_new (parent, alert);
+
+ if (parent) {
+ gtk_window_set_urgency_hint (parent, TRUE);
+ signal_id = g_signal_connect (dialog, "focus-in-event", G_CALLBACK
(dialog_focus_in_event_cb), parent);
+ } else {
+ gtk_window_set_urgency_hint (GTK_WINDOW (dialog), TRUE);
+ }
+
response = gtk_dialog_run (GTK_DIALOG (dialog));
+
+ if (parent) {
+ gtk_window_set_urgency_hint (parent, FALSE);
+ if (signal_id)
+ g_signal_handler_disconnect (dialog, signal_id);
+ }
+
gtk_widget_destroy (dialog);
return response;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]