aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2013-06-24 20:48:00 +0800
committerMilan Crha <mcrha@redhat.com>2013-06-24 20:52:50 +0800
commit69976cc0852f4a84288e1b71cc72f101ca17b6b1 (patch)
treede9ed66321545b2bac5050ed7426f5cf49ec9906 /e-util
parent2a3580e43deb40eca14ed7ff16ad5cac6a7a5e2b (diff)
downloadgsoc2013-evolution-69976cc0852f4a84288e1b71cc72f101ca17b6b1.tar
gsoc2013-evolution-69976cc0852f4a84288e1b71cc72f101ca17b6b1.tar.gz
gsoc2013-evolution-69976cc0852f4a84288e1b71cc72f101ca17b6b1.tar.bz2
gsoc2013-evolution-69976cc0852f4a84288e1b71cc72f101ca17b6b1.tar.lz
gsoc2013-evolution-69976cc0852f4a84288e1b71cc72f101ca17b6b1.tar.xz
gsoc2013-evolution-69976cc0852f4a84288e1b71cc72f101ca17b6b1.tar.zst
gsoc2013-evolution-69976cc0852f4a84288e1b71cc72f101ca17b6b1.zip
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.
Diffstat (limited to 'e-util')
-rw-r--r--e-util/e-alert-dialog.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/e-util/e-alert-dialog.c b/e-util/e-alert-dialog.c
index b4e12ad8c9..156c2729ac 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;