[gnome-disk-utility/new-ui: 77/80] Add a new error dialog class



commit be7187b1b365ceeae7cfbaeeb3c3ab4e86acc9cb
Author: David Zeuthen <davidz redhat com>
Date:   Wed Sep 23 11:31:57 2009 -0700

    Add a new error dialog class

 src/gdu-gtk/Makefile.am              |    2 +
 src/gdu-gtk/gdu-error-dialog.c       |  410 ++++++++++++++++++++++++++++++++++
 src/gdu-gtk/gdu-error-dialog.h       |   72 ++++++
 src/gdu-gtk/gdu-gtk-types.h          |    1 +
 src/gdu-gtk/gdu-gtk.h                |    1 +
 src/palimpsest/gdu-section-drive.c   |   26 ++-
 src/palimpsest/gdu-section-volumes.c |   13 +-
 7 files changed, 513 insertions(+), 12 deletions(-)
---
diff --git a/src/gdu-gtk/Makefile.am b/src/gdu-gtk/Makefile.am
index 9da383f..32eda03 100644
--- a/src/gdu-gtk/Makefile.am
+++ b/src/gdu-gtk/Makefile.am
@@ -40,6 +40,7 @@ libgdu_gtkinclude_HEADERS =              				\
 	gdu-volume-grid.h						\
 	gdu-details-table.h						\
 	gdu-details-element.h						\
+	gdu-error-dialog.h						\
 	$(NULL)
 
 libgdu_gtk_la_SOURCES =                 	               				\
@@ -57,6 +58,7 @@ libgdu_gtk_la_SOURCES =                 	               				\
 	gdu-volume-grid.h			gdu-volume-grid.c			\
 	gdu-details-table.h			gdu-details-table.c			\
 	gdu-details-element.h			gdu-details-element.c			\
+	gdu-error-dialog.h			gdu-error-dialog.c			\
 	$(NULL)
 
 libgdu_gtk_la_CPPFLAGS = 				\
diff --git a/src/gdu-gtk/gdu-error-dialog.c b/src/gdu-gtk/gdu-error-dialog.c
new file mode 100644
index 0000000..70516eb
--- /dev/null
+++ b/src/gdu-gtk/gdu-error-dialog.c
@@ -0,0 +1,410 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+/* gdu-ata-smart-dialog.c
+ *
+ * Copyright (C) 2009 David Zeuthen
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#include <config.h>
+#include <glib/gi18n.h>
+#include <atasmart.h>
+#include <glib/gstdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+
+#include "gdu-error-dialog.h"
+
+/* ---------------------------------------------------------------------------------------------------- */
+/* Gah, someone box GError in libgobject already */
+
+#define GDU_TYPE_ERROR (gdu_error_get_type ())
+
+static GError *
+gdu_error_copy (const GError *error)
+{
+        return g_error_copy (error);
+}
+
+static void
+gdu_error_free (GError *error)
+{
+        g_error_free (error);
+}
+
+static GType
+gdu_error_get_type (void)
+{
+        static volatile gsize type_volatile = 0;
+
+        if (g_once_init_enter (&type_volatile)) {
+                GType type = g_boxed_type_register_static (
+                                                           g_intern_static_string ("GduGError"),
+                                                           (GBoxedCopyFunc) gdu_error_copy,
+                                                           (GBoxedFreeFunc) gdu_error_free);
+                g_once_init_leave (&type_volatile, type);
+        }
+
+        return type_volatile;
+}
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+struct GduErrorDialogPrivate
+{
+        GduPresentable *presentable;
+        gchar          *message;
+        GError         *error;
+};
+
+enum
+{
+        PROP_0,
+        PROP_PRESENTABLE,
+        PROP_DRIVE_DEVICE,
+        PROP_VOLUME_DEVICE,
+        PROP_MESSAGE,
+        PROP_ERROR
+};
+
+
+G_DEFINE_TYPE (GduErrorDialog, gdu_error_dialog, GTK_TYPE_DIALOG)
+
+static void
+gdu_error_dialog_finalize (GObject *object)
+{
+        GduErrorDialog *dialog = GDU_ERROR_DIALOG (object);
+
+        if (dialog->priv->presentable != NULL) {
+                g_object_unref (dialog->priv->presentable);
+        }
+        g_free (dialog->priv->message);
+        g_error_free (dialog->priv->error);
+
+        if (G_OBJECT_CLASS (gdu_error_dialog_parent_class)->finalize != NULL)
+                G_OBJECT_CLASS (gdu_error_dialog_parent_class)->finalize (object);
+}
+
+static void
+gdu_error_dialog_get_property (GObject    *object,
+                               guint       property_id,
+                               GValue     *value,
+                               GParamSpec *pspec)
+{
+        GduErrorDialog *dialog = GDU_ERROR_DIALOG (object);
+
+        switch (property_id) {
+        case PROP_PRESENTABLE:
+                g_value_set_object (value, dialog->priv->presentable);
+                break;
+
+        case PROP_MESSAGE:
+                g_value_set_string (value, dialog->priv->message);
+                break;
+
+        case PROP_ERROR:
+                g_value_set_boxed (value, dialog->priv->error);
+                break;
+
+        default:
+                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+                break;
+        }
+}
+
+static void
+gdu_error_dialog_set_property (GObject      *object,
+                               guint         property_id,
+                               const GValue *value,
+                               GParamSpec   *pspec)
+{
+        GduErrorDialog *dialog = GDU_ERROR_DIALOG (object);
+        GduDevice *device;
+        GduPool *pool;
+
+        switch (property_id) {
+        case PROP_PRESENTABLE:
+                if (g_value_get_object (value) != NULL) {
+                        g_warn_if_fail (dialog->priv->presentable == NULL);
+                        dialog->priv->presentable = g_value_dup_object (value);
+                }
+                break;
+
+        case PROP_DRIVE_DEVICE:
+                device = GDU_DEVICE (g_value_get_object (value));
+                if (device != NULL) {
+                        pool = gdu_device_get_pool (device);
+                        g_warn_if_fail (dialog->priv->presentable == NULL);
+                        dialog->priv->presentable = gdu_pool_get_drive_by_device (pool, device);
+                        g_object_unref (pool);
+                }
+                break;
+
+        case PROP_VOLUME_DEVICE:
+                device = GDU_DEVICE (g_value_get_object (value));
+                if (device != NULL) {
+                        pool = gdu_device_get_pool (device);
+                        g_warn_if_fail (dialog->priv->presentable == NULL);
+                        dialog->priv->presentable = gdu_pool_get_volume_by_device (pool, device);
+                        g_object_unref (pool);
+                }
+                break;
+
+        case PROP_MESSAGE:
+                dialog->priv->message = g_value_dup_string (value);
+                break;
+
+        case PROP_ERROR:
+                dialog->priv->error = g_value_dup_boxed (value);
+                break;
+
+        default:
+                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+        }
+}
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static void
+gdu_error_dialog_constructed (GObject *object)
+{
+        GduErrorDialog *dialog = GDU_ERROR_DIALOG (object);
+        GtkWidget *content_area;
+        GtkWidget *hbox;
+        GtkWidget *vbox;
+        GtkWidget *image;
+        GtkWidget *label;
+        gchar *s;
+        GIcon *icon;
+        GEmblem *emblem;
+        GIcon *error_icon;
+        GIcon *emblemed_icon;
+        gchar *name;
+        gchar *vpd_name;
+        const gchar *error_msg;
+
+        icon = NULL;
+        name = NULL;
+        vpd_name = NULL;
+
+        gtk_window_set_title (GTK_WINDOW (dialog), _(""));
+        gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
+        gtk_container_set_border_width (GTK_CONTAINER (dialog), 12);
+
+        gtk_dialog_add_button (GTK_DIALOG (dialog),
+                               GTK_STOCK_CLOSE,
+                               GTK_RESPONSE_CLOSE);
+
+        content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+
+        icon = gdu_presentable_get_icon (dialog->priv->presentable);
+        error_icon = g_themed_icon_new (GTK_STOCK_DIALOG_ERROR);
+        emblem = g_emblem_new (icon);
+        emblemed_icon = g_emblemed_icon_new (error_icon,
+                                             emblem);
+
+        hbox = gtk_hbox_new (FALSE, 12);
+        gtk_box_pack_start (GTK_BOX (content_area), hbox, TRUE, TRUE, 0);
+
+        image = gtk_image_new_from_gicon (emblemed_icon,
+                                          GTK_ICON_SIZE_DIALOG);
+        gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0);
+        gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
+
+        vbox = gtk_vbox_new (FALSE, 12);
+        gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0);
+
+        s = g_strdup_printf ("<big><big><b>%s</b></big></big>",
+                             dialog->priv->message);
+        label = gtk_label_new (NULL);
+        gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+        gtk_label_set_markup (GTK_LABEL (label), s);
+        g_free (s);
+        gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+
+        error_msg = NULL;
+        if (dialog->priv->error->domain == GDU_ERROR) {
+                switch (dialog->priv->error->code) {
+                case GDU_ERROR_FAILED:
+                        error_msg = _("The operation failed");
+                        break;
+                case GDU_ERROR_BUSY:
+                        error_msg = _("The device is busy");
+                        break;
+                case GDU_ERROR_CANCELLED:
+                        error_msg = _("The operation was canceled");
+                        break;
+                case GDU_ERROR_INHIBITED:
+                        error_msg = _("The daemon is being inhibited");
+                        break;
+                case GDU_ERROR_INVALID_OPTION:
+                        error_msg = _("An invalid option was passed");
+                        break;
+                case GDU_ERROR_NOT_SUPPORTED:
+                        error_msg = _("The operation is not supported");
+                        break;
+                case GDU_ERROR_ATA_SMART_WOULD_WAKEUP:
+                        error_msg = _("Getting ATA SMART data would wake up the device");
+                        break;
+                case GDU_ERROR_PERMISSION_DENIED:
+                        error_msg = _("Permission denied");
+                        break;
+                }
+        }
+        if (error_msg == NULL)
+                error_msg = _("Unknown error");
+
+        name = gdu_presentable_get_name (dialog->priv->presentable);
+        vpd_name = gdu_presentable_get_vpd_name (dialog->priv->presentable);
+        s = g_strdup_printf (_("An error occured while performing an operation "
+                               "on \"%s\" (%s): %s"),
+                             name,
+                             vpd_name,
+                             error_msg);
+
+        label = gtk_label_new (s);
+        g_free (s);
+        gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+	gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+        gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+
+        g_object_unref (icon);
+        g_object_unref (emblem);
+        g_object_unref (error_icon);
+        g_object_unref (emblemed_icon);
+
+        g_free (name);
+        g_free (vpd_name);
+
+        if (G_OBJECT_CLASS (gdu_error_dialog_parent_class)->constructed != NULL)
+                G_OBJECT_CLASS (gdu_error_dialog_parent_class)->constructed (object);
+}
+
+static void
+gdu_error_dialog_class_init (GduErrorDialogClass *klass)
+{
+        GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+        g_type_class_add_private (klass, sizeof (GduErrorDialogPrivate));
+
+        object_class->get_property = gdu_error_dialog_get_property;
+        object_class->set_property = gdu_error_dialog_set_property;
+        object_class->constructed  = gdu_error_dialog_constructed;
+        object_class->finalize     = gdu_error_dialog_finalize;
+
+        g_object_class_install_property (object_class,
+                                         PROP_PRESENTABLE,
+                                         g_param_spec_object ("presentable",
+                                                              NULL,
+                                                              NULL,
+                                                              GDU_TYPE_PRESENTABLE,
+                                                              G_PARAM_READABLE |
+                                                              G_PARAM_WRITABLE |
+                                                              G_PARAM_CONSTRUCT_ONLY));
+
+        g_object_class_install_property (object_class,
+                                         PROP_DRIVE_DEVICE,
+                                         g_param_spec_object ("drive-device",
+                                                              NULL,
+                                                              NULL,
+                                                              GDU_TYPE_DEVICE,
+                                                              G_PARAM_WRITABLE |
+                                                              G_PARAM_CONSTRUCT_ONLY));
+
+        g_object_class_install_property (object_class,
+                                         PROP_VOLUME_DEVICE,
+                                         g_param_spec_object ("volume-device",
+                                                              NULL,
+                                                              NULL,
+                                                              GDU_TYPE_DEVICE,
+                                                              G_PARAM_WRITABLE |
+                                                              G_PARAM_CONSTRUCT_ONLY));
+
+        g_object_class_install_property (object_class,
+                                         PROP_MESSAGE,
+                                         g_param_spec_string ("message",
+                                                              NULL,
+                                                              NULL,
+                                                              NULL,
+                                                              G_PARAM_READABLE |
+                                                              G_PARAM_WRITABLE |
+                                                              G_PARAM_CONSTRUCT_ONLY));
+
+        g_object_class_install_property (object_class,
+                                         PROP_ERROR,
+                                         g_param_spec_boxed ("error",
+                                                             NULL,
+                                                             NULL,
+                                                             GDU_TYPE_ERROR,
+                                                             G_PARAM_READABLE |
+                                                             G_PARAM_WRITABLE |
+                                                             G_PARAM_CONSTRUCT_ONLY));
+}
+
+static void
+gdu_error_dialog_init (GduErrorDialog *dialog)
+{
+        dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (dialog, GDU_TYPE_ERROR_DIALOG, GduErrorDialogPrivate);
+}
+
+GtkWidget *
+gdu_error_dialog_new (GtkWindow      *parent,
+                      GduPresentable *presentable,
+                      const gchar    *message,
+                      const GError   *error)
+{
+        g_return_val_if_fail (GDU_IS_PRESENTABLE (presentable), NULL);
+        return GTK_WIDGET (g_object_new (GDU_TYPE_ERROR_DIALOG,
+                                         "transient-for", parent,
+                                         "presentable", presentable,
+                                         "message", message,
+                                         "error", error,
+                                         NULL));
+}
+
+GtkWidget *
+gdu_error_dialog_for_drive (GtkWindow      *parent,
+                            GduDevice      *device,
+                            const gchar    *message,
+                            const GError   *error)
+{
+        g_return_val_if_fail (GDU_IS_DEVICE (device), NULL);
+        return GTK_WIDGET (g_object_new (GDU_TYPE_ERROR_DIALOG,
+                                         "transient-for", parent,
+                                         "drive-device", device,
+                                         "message", message,
+                                         "error", error,
+                                         NULL));
+}
+
+GtkWidget *
+gdu_error_dialog_for_volume (GtkWindow      *parent,
+                             GduDevice      *device,
+                             const gchar    *message,
+                             const GError   *error)
+{
+        g_return_val_if_fail (GDU_IS_DEVICE (device), NULL);
+        return GTK_WIDGET (g_object_new (GDU_TYPE_ERROR_DIALOG,
+                                         "transient-for", parent,
+                                         "volume-device", device,
+                                         "message", message,
+                                         "error", error,
+                                         NULL));
+}
+
+/* ---------------------------------------------------------------------------------------------------- */
diff --git a/src/gdu-gtk/gdu-error-dialog.h b/src/gdu-gtk/gdu-error-dialog.h
new file mode 100644
index 0000000..77494f5
--- /dev/null
+++ b/src/gdu-gtk/gdu-error-dialog.h
@@ -0,0 +1,72 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+/* gdu-ata-smart-dialog.h
+ *
+ * Copyright (C) 2009 David Zeuthen
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#if !defined (__GDU_GTK_INSIDE_GDU_GTK_H) && !defined (GDU_GTK_COMPILATION)
+#error "Only <gdu-gtk/gdu-gtk.h> can be included directly, this file may disappear or change contents."
+#endif
+
+#ifndef __GDU_ERROR_DIALOG_H
+#define __GDU_ERROR_DIALOG_H
+
+#include <gdu-gtk/gdu-gtk-types.h>
+
+G_BEGIN_DECLS
+
+#define GDU_TYPE_ERROR_DIALOG            gdu_error_dialog_get_type()
+#define GDU_ERROR_DIALOG(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDU_TYPE_ERROR_DIALOG, GduErrorDialog))
+#define GDU_ERROR_DIALOG_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GDU_TYPE_ERROR_DIALOG, GduErrorDialogClass))
+#define GDU_IS_ERROR_DIALOG(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDU_TYPE_ERROR_DIALOG))
+#define GDU_IS_ERROR_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDU_TYPE_ERROR_DIALOG))
+#define GDU_ERROR_DIALOG_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GDU_TYPE_ERROR_DIALOG, GduErrorDialogClass))
+
+typedef struct GduErrorDialogClass   GduErrorDialogClass;
+typedef struct GduErrorDialogPrivate GduErrorDialogPrivate;
+
+struct GduErrorDialog
+{
+        GtkDialog parent;
+
+        /*< private >*/
+        GduErrorDialogPrivate *priv;
+};
+
+struct GduErrorDialogClass
+{
+        GtkDialogClass parent_class;
+};
+
+GType       gdu_error_dialog_get_type (void) G_GNUC_CONST;
+GtkWidget  *gdu_error_dialog_new             (GtkWindow      *parent,
+                                              GduPresentable *presentable,
+                                              const gchar    *message,
+                                              const GError   *error);
+GtkWidget  *gdu_error_dialog_for_drive       (GtkWindow      *parent,
+                                              GduDevice      *device,
+                                              const gchar    *message,
+                                              const GError   *error);
+GtkWidget  *gdu_error_dialog_for_volume      (GtkWindow      *parent,
+                                              GduDevice      *device,
+                                              const gchar    *message,
+                                              const GError   *error);
+
+G_END_DECLS
+
+#endif /* __GDU_ERROR_DIALOG_H */
diff --git a/src/gdu-gtk/gdu-gtk-types.h b/src/gdu-gtk/gdu-gtk-types.h
index cb6c740..4103ee8 100644
--- a/src/gdu-gtk/gdu-gtk-types.h
+++ b/src/gdu-gtk/gdu-gtk-types.h
@@ -47,6 +47,7 @@ typedef struct GduSizeWidget               GduSizeWidget;
 typedef struct GduVolumeGrid               GduVolumeGrid;
 typedef struct GduDetailsTable             GduDetailsTable;
 typedef struct GduDetailsElement           GduDetailsElement;
+typedef struct GduErrorDialog              GduErrorDialog;
 
 G_END_DECLS
 
diff --git a/src/gdu-gtk/gdu-gtk.h b/src/gdu-gtk/gdu-gtk.h
index 89bce01..360ddbc 100644
--- a/src/gdu-gtk/gdu-gtk.h
+++ b/src/gdu-gtk/gdu-gtk.h
@@ -39,6 +39,7 @@
 #include <gdu-gtk/gdu-volume-grid.h>
 #include <gdu-gtk/gdu-details-table.h>
 #include <gdu-gtk/gdu-details-element.h>
+#include <gdu-gtk/gdu-error-dialog.h>
 #undef __GDU_GTK_INSIDE_GDU_GTK_H
 
 G_BEGIN_DECLS
diff --git a/src/palimpsest/gdu-section-drive.c b/src/palimpsest/gdu-section-drive.c
index 340b5c9..8707168 100644
--- a/src/palimpsest/gdu-section-drive.c
+++ b/src/palimpsest/gdu-section-drive.c
@@ -322,10 +322,15 @@ eject_op_callback (GduDevice *device,
         GduShell *shell = GDU_SHELL (user_data);
 
         if (error != NULL) {
-                gdu_shell_raise_error (shell,
-                                       NULL,
-                                       error,
-                                       _("Error ejecting device"));
+                GtkWidget *dialog;
+                dialog = gdu_error_dialog_for_drive (GTK_WINDOW (gdu_shell_get_toplevel (shell)),
+                                                     device,
+                                                     _("Error ejecting media"),
+                                                     error);
+                gtk_widget_show_all (dialog);
+                gtk_window_present (GTK_WINDOW (dialog));
+                gtk_dialog_run (GTK_DIALOG (dialog));
+                gtk_widget_destroy (dialog);
                 g_error_free (error);
         }
         g_object_unref (shell);
@@ -361,10 +366,15 @@ detach_op_callback (GduDevice *device,
         GduShell *shell = GDU_SHELL (user_data);
 
         if (error != NULL) {
-                gdu_shell_raise_error (shell,
-                                       NULL,
-                                       error,
-                                       _("Error detaching device"));
+                GtkWidget *dialog;
+                dialog = gdu_error_dialog_for_drive (GTK_WINDOW (gdu_shell_get_toplevel (shell)),
+                                                     device,
+                                                     _("Error detaching drive"),
+                                                     error);
+                gtk_widget_show_all (dialog);
+                gtk_window_present (GTK_WINDOW (dialog));
+                gtk_dialog_run (GTK_DIALOG (dialog));
+                gtk_widget_destroy (dialog);
                 g_error_free (error);
         }
         g_object_unref (shell);
diff --git a/src/palimpsest/gdu-section-volumes.c b/src/palimpsest/gdu-section-volumes.c
index 9952e8f..576d5bc 100644
--- a/src/palimpsest/gdu-section-volumes.c
+++ b/src/palimpsest/gdu-section-volumes.c
@@ -153,10 +153,15 @@ unmount_op_callback (GduDevice *device,
         /* TODO: handle busy mounts using GtkMountOperation */
 
         if (error != NULL) {
-                gdu_shell_raise_error (shell,
-                                       NULL,
-                                       error,
-                                       _("Error unmounting device"));
+                GtkWidget *dialog;
+                dialog = gdu_error_dialog_for_volume (GTK_WINDOW (gdu_shell_get_toplevel (shell)),
+                                                      device,
+                                                      _("Error unmounting volume"),
+                                                      error);
+                gtk_widget_show_all (dialog);
+                gtk_window_present (GTK_WINDOW (dialog));
+                gtk_dialog_run (GTK_DIALOG (dialog));
+                gtk_widget_destroy (dialog);
                 g_error_free (error);
         }
         g_object_unref (shell);



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