[gnome-disk-utility] nuke the "It's now safe to remove" dialog after four seconds



commit 07cde4c831da944fe018cf21cf8ca70b6488251a
Author: David Zeuthen <davidz redhat com>
Date:   Wed Apr 15 14:20:49 2009 -0400

    nuke the "It's now safe to remove" dialog after four seconds
---
 src/notification/gdu-slow-unmount-dialog.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/notification/gdu-slow-unmount-dialog.c b/src/notification/gdu-slow-unmount-dialog.c
index dc95be6..02dea3c 100644
--- a/src/notification/gdu-slow-unmount-dialog.c
+++ b/src/notification/gdu-slow-unmount-dialog.c
@@ -126,6 +126,17 @@ on_pulse_timeout (gpointer user_data)
         return TRUE;
 }
 
+static gboolean
+nuke_dialog_cb (gpointer user_data)
+{
+        GduSlowUnmountDialog *dialog = GDU_SLOW_UNMOUNT_DIALOG (user_data);
+
+        gtk_widget_destroy (GTK_WIDGET (dialog));
+        g_object_unref (dialog);
+
+        return FALSE;
+}
+
 static void
 check_still_unmounting (GduSlowUnmountDialog *dialog)
 {
@@ -152,6 +163,11 @@ check_still_unmounting (GduSlowUnmountDialog *dialog)
                              dialog->priv->device_name);
         gtk_label_set_markup (GTK_LABEL (dialog->priv->label), s);
 
+        /* nuke this dialog after four seconds */
+        g_timeout_add (4 * 1000,
+                       nuke_dialog_cb,
+                       g_object_ref (dialog));
+
  out:
         ;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]