[gnome-disk-utility/udisks2-port] Display raid name/label, if available
- From: David Zeuthen <davidz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-disk-utility/udisks2-port] Display raid name/label, if available
- Date: Tue, 11 Oct 2011 11:58:55 +0000 (UTC)
commit 844e1dcf9c6b3fc9cdda96154b94e93005eabfc0
Author: David Zeuthen <davidz redhat com>
Date: Tue Oct 11 07:57:59 2011 -0400
Display raid name/label, if available
See e.g. http://people.freedesktop.org/~david/palimpsest-zfs-pool-name.png
Signed-off-by: David Zeuthen <davidz redhat com>
src/palimpsest/gduvolumegrid.c | 22 +++++++++++++++++-----
1 files changed, 17 insertions(+), 5 deletions(-)
---
diff --git a/src/palimpsest/gduvolumegrid.c b/src/palimpsest/gduvolumegrid.c
index 7ca4a80..942c239 100644
--- a/src/palimpsest/gduvolumegrid.c
+++ b/src/palimpsest/gduvolumegrid.c
@@ -1946,10 +1946,12 @@ grid_element_set_details (GduVolumeGrid *grid,
{
UDisksBlock *block;
gchar *s;
+ const gchar *cs;
gchar *size_str;
const gchar *usage;
const gchar *type;
const gchar *version;
+ const gchar *label;
gint partition_type;
gchar *type_for_display;
UDisksFilesystem *filesystem;
@@ -1961,6 +1963,7 @@ grid_element_set_details (GduVolumeGrid *grid,
usage = udisks_block_get_id_usage (block);
type = udisks_block_get_id_type (block);
version = udisks_block_get_id_version (block);
+ label = udisks_block_get_id_label (block);
partition_type = strtol (udisks_block_get_part_entry_type (block), NULL, 0);
if (g_variant_n_children (udisks_block_get_configuration (block)) > 0)
@@ -1990,12 +1993,12 @@ grid_element_set_details (GduVolumeGrid *grid,
}
else
{
- const gchar *label;
- label = udisks_block_get_id_label (block);
type_for_display = udisks_util_get_id_for_display (usage, type, version, FALSE);
- if (strlen (label) == 0)
- label = C_("volume-grid", "Filesystem");
- s = g_strdup_printf ("%s\n%s %s", label, size_str, type_for_display);
+ if (strlen (label) > 0)
+ cs = label;
+ else
+ cs = C_("volume-grid", "Filesystem");
+ s = g_strdup_printf ("%s\n%s %s", cs, size_str, type_for_display);
g_free (type_for_display);
}
g_clear_object (&drive);
@@ -2023,6 +2026,15 @@ grid_element_set_details (GduVolumeGrid *grid,
element->show_mounted = TRUE;
}
}
+ else if (g_strcmp0 (usage, "raid") == 0 && strlen (label) > 0)
+ {
+ type_for_display = udisks_util_get_id_for_display (usage, type, version, FALSE);
+ s = g_strdup_printf ("%s\n%s %s",
+ label,
+ size_str,
+ type_for_display);
+ g_free (type_for_display);
+ }
else
{
type_for_display = udisks_util_get_id_for_display (usage, type, version, FALSE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]