[gnome-disk-utility/wip/mdraid] Take name, homehost into account when rendering Linux RAID members in the grid
- From: David Zeuthen <davidz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-disk-utility/wip/mdraid] Take name, homehost into account when rendering Linux RAID members in the grid
- Date: Fri, 21 Sep 2012 16:35:13 +0000 (UTC)
commit bda3fa90113a93f0595b37b449772d2cc1744c9a
Author: David Zeuthen <zeuthen gmail com>
Date: Fri Sep 21 12:33:12 2012 -0400
Take name, homehost into account when rendering Linux RAID members in the grid
Signed-off-by: David Zeuthen <zeuthen gmail com>
src/disks/gduvolumegrid.c | 27 ++++++++++++++++++++++++++-
1 files changed, 26 insertions(+), 1 deletions(-)
---
diff --git a/src/disks/gduvolumegrid.c b/src/disks/gduvolumegrid.c
index 35bc54e..b931435 100644
--- a/src/disks/gduvolumegrid.c
+++ b/src/disks/gduvolumegrid.c
@@ -1678,7 +1678,32 @@ grid_element_set_details (GduVolumeGrid *grid,
else if (g_strcmp0 (usage, "raid") == 0 && strlen (label) > 0)
{
type_for_display = udisks_client_get_id_for_display (grid->client, usage, type, version, FALSE);
- g_ptr_array_add (lines, g_strdup (label));
+ if (g_strcmp0 (type, "linux_raid_member") == 0)
+ {
+ const gchar *sep = strstr (label, ":");
+ if (sep != NULL && strlen (sep) > 1)
+ {
+ gchar *homehost = g_strndup (label, sep - label);
+ g_ptr_array_add (lines,
+ /* Translators: Shown in volume grid for Linux RAID members. Please
+ * keep this as short as possible.
+ * The first %s is the array name (e.g. 'MirrorOnTheWall').
+ * The second %s is the homehost (e.g. 'thinkpad').
+ */
+ g_strdup_printf (C_("volume-grid", "%s [local to %s]"),
+ sep + 1,
+ homehost));
+ g_free (homehost);
+ }
+ else
+ {
+ g_ptr_array_add (lines, g_strdup (label));
+ }
+ }
+ else
+ {
+ g_ptr_array_add (lines, g_strdup (label));
+ }
maybe_add_partition (grid, lines, partition);
g_ptr_array_add (lines, g_strdup_printf ("%s %s", size_str, type_for_display));
g_free (type_for_display);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]