[gnome-disk-utility] Only ask for confirmation for drive power off, if multiple drives are involved



commit 2eb3bd62a92b5925b93c981c2badb5e38e3d4612
Author: David Zeuthen <zeuthen gmail com>
Date:   Fri Jan 4 13:08:00 2013 -0500

    Only ask for confirmation for drive power off, if multiple drives are involved
    
    Signed-off-by: David Zeuthen <zeuthen gmail com>

 src/disks/gduwindow.c |   24 ++++++++----------------
 1 files changed, 8 insertions(+), 16 deletions(-)
---
diff --git a/src/disks/gduwindow.c b/src/disks/gduwindow.c
index 24e02f2..b37ed29 100644
--- a/src/disks/gduwindow.c
+++ b/src/disks/gduwindow.c
@@ -4067,29 +4067,21 @@ do_power_off (GduWindow *window)
         objects = g_list_append (objects, sibling_object);
     }
 
-  if (siblings == NULL)
-    {
-      /* Translators: Heading for powering off a device with a single drive */
-      heading = _("Are you sure you want to power off the drive?");
-      /* Translators: Message for powering off a device with a single drive */
-      message = _("This operation will prepare the system for the drive to be removed and powered down.");
-    }
-  else
+  if (siblings != NULL)
     {
       /* Translators: Heading for powering off a device with multiple drives */
       heading = _("Are you sure you want to power off the drives?");
       /* Translators: Message for powering off a device with multiple drives */
       message = _("This operation will prepare the system for the following drives to be removed and powered down.");
+      if (!gdu_utils_show_confirmation (GTK_WINDOW (window),
+                                        heading,
+                                        message,
+                                        _("_Power Off"),
+                                        NULL, NULL,
+                                        window->client, objects))
+        goto out;
     }
 
-  if (!gdu_utils_show_confirmation (GTK_WINDOW (window),
-                                    heading,
-                                    message,
-                                    _("_Power Off"),
-                                    NULL, NULL,
-                                    window->client, objects))
-    goto out;
-
   gdu_window_ensure_unused_list (window,
                                  objects,
                                  (GAsyncReadyCallback) power_off_ensure_unused_cb,



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