[gnome-disk-utility/new-ui] Unify Host Adapters and Expanders in the GduHub presentable



commit 850e9bc0008aa6cf034ac6861c01235e37e3e04e
Author: David Zeuthen <davidz redhat com>
Date:   Mon Nov 30 20:28:11 2009 -0500

    Unify Host Adapters and Expanders in the GduHub presentable

 src/gdu/Makefile.am              |    2 -
 src/gdu/gdu-hba.c                |  251 --------------------------------------
 src/gdu/gdu-hba.h                |   61 ---------
 src/gdu/gdu-hub.c                |   90 ++++++++++++--
 src/gdu/gdu-hub.h                |    1 +
 src/gdu/gdu-pool.c               |   49 ++++----
 src/gdu/gdu-private.h            |    9 +-
 src/gdu/gdu-types.h              |    1 -
 src/gdu/gdu.h                    |    1 -
 src/palimpsest/Makefile.am       |    1 -
 src/palimpsest/gdu-section-hba.c |  235 -----------------------------------
 src/palimpsest/gdu-section-hba.h |   58 ---------
 src/palimpsest/gdu-section-hub.c |   97 +++++++++++----
 src/palimpsest/gdu-shell.c       |    7 +-
 14 files changed, 182 insertions(+), 681 deletions(-)
---
diff --git a/src/gdu/Makefile.am b/src/gdu/Makefile.am
index 0b7cbc2..e5b62f5 100644
--- a/src/gdu/Makefile.am
+++ b/src/gdu/Makefile.am
@@ -51,7 +51,6 @@ libgduinclude_HEADERS =              			\
 	gdu-util.h					\
 	gdu-volume.h					\
 	gdu-volume-hole.h				\
-	gdu-hba.h					\
 	gdu-hub.h					\
 	$(NULL)
 
@@ -73,7 +72,6 @@ libgdu_la_SOURCES =                                					\
 	gdu-known-filesystem.c			gdu-known-filesystem.h			\
 	gdu-error.c				gdu-error.h				\
 	gdu-process.c				gdu-process.h				\
-	gdu-hba.c				gdu-hba.h				\
 	gdu-hub.c				gdu-hub.h				\
 						gdu-private.h				\
 	$(BUILT_SOURCES)								\
diff --git a/src/gdu/gdu-hub.c b/src/gdu/gdu-hub.c
index 0986d74..df3df41 100644
--- a/src/gdu/gdu-hub.c
+++ b/src/gdu/gdu-hub.c
@@ -28,6 +28,7 @@
 #include "gdu-private.h"
 #include "gdu-util.h"
 #include "gdu-pool.h"
+#include "gdu-adapter.h"
 #include "gdu-expander.h"
 #include "gdu-hub.h"
 #include "gdu-presentable.h"
@@ -38,14 +39,15 @@
  * @title: GduHub
  * @short_description: HUBs
  *
- * #GduHub objects are used to represent host board expanders (also
- * called disk expanders).
+ * #GduHub objects are used to represent Host Adapters and Expanders
+ * (e.g. SAS Expanders and SATA Port Multipliers).
  *
  * See the documentation for #GduPresentable for the big picture.
  */
 
 struct _GduHubPrivate
 {
+        GduAdapter *adapter;
         GduExpander *expander;
         GduPool *pool;
         GduPresentable *enclosing_presentable;
@@ -59,6 +61,7 @@ G_DEFINE_TYPE_WITH_CODE (GduHub, gdu_hub, G_TYPE_OBJECT,
                          G_IMPLEMENT_INTERFACE (GDU_TYPE_PRESENTABLE,
                                                 gdu_hub_presentable_iface_init))
 
+static void adapter_changed (GduAdapter *adapter, gpointer user_data);
 static void expander_changed (GduExpander *expander, gpointer user_data);
 
 
@@ -74,6 +77,11 @@ gdu_hub_finalize (GObject *object)
                 g_object_unref (hub->priv->expander);
         }
 
+        if (hub->priv->adapter != NULL) {
+                g_signal_handlers_disconnect_by_func (hub->priv->adapter, adapter_changed, hub);
+                g_object_unref (hub->priv->adapter);
+        }
+
         if (hub->priv->pool != NULL)
                 g_object_unref (hub->priv->pool);
 
@@ -105,6 +113,14 @@ gdu_hub_init (GduHub *hub)
 }
 
 static void
+adapter_changed (GduAdapter *adapter, gpointer user_data)
+{
+        GduHub *hub = GDU_HUB (user_data);
+        g_signal_emit_by_name (hub, "changed");
+        g_signal_emit_by_name (hub->priv->pool, "presentable-changed", hub);
+}
+
+static void
 expander_changed (GduExpander *expander, gpointer user_data)
 {
         GduHub *hub = GDU_HUB (user_data);
@@ -112,18 +128,28 @@ expander_changed (GduExpander *expander, gpointer user_data)
         g_signal_emit_by_name (hub->priv->pool, "presentable-changed", hub);
 }
 
+/* expander may be NULL */
 GduHub *
-_gdu_hub_new_from_expander (GduPool *pool, GduExpander *expander, GduPresentable *enclosing_presentable)
+_gdu_hub_new (GduPool        *pool,
+              GduAdapter     *adapter,
+              GduExpander    *expander,
+              GduPresentable *enclosing_presentable)
 {
         GduHub *hub;
 
         hub = GDU_HUB (g_object_new (GDU_TYPE_HUB, NULL));
-        hub->priv->expander = g_object_ref (expander);
+        hub->priv->adapter = g_object_ref (adapter);
+        hub->priv->expander = expander != NULL ? g_object_ref (expander) : NULL;
         hub->priv->pool = g_object_ref (pool);
         hub->priv->enclosing_presentable =
                 enclosing_presentable != NULL ? g_object_ref (enclosing_presentable) : NULL;
-        hub->priv->id = g_strdup (gdu_expander_get_native_path (hub->priv->expander));
-        g_signal_connect (expander, "changed", (GCallback) expander_changed, hub);
+        if (expander != NULL)
+                hub->priv->id = g_strdup (gdu_expander_get_native_path (hub->priv->expander));
+        else
+                hub->priv->id = g_strdup (gdu_adapter_get_native_path (hub->priv->adapter));
+        g_signal_connect (adapter, "changed", (GCallback) adapter_changed, hub);
+        if (expander != NULL)
+                g_signal_connect (expander, "changed", (GCallback) expander_changed, hub);
         return hub;
 }
 
@@ -152,8 +178,34 @@ gdu_hub_get_enclosing_presentable (GduPresentable *presentable)
 static char *
 gdu_hub_get_name (GduPresentable *presentable)
 {
+        GduHub *hub = GDU_HUB (presentable);
+        gchar *ret;
+
         /* TODO: include type e.g. SATA Port Multiplier, SAS Expander etc */
-        return g_strdup (_("SAS Expander"));
+        if (hub->priv->expander == NULL) {
+                const gchar *fabric;
+
+                fabric = gdu_adapter_get_fabric (hub->priv->adapter);
+
+                if (g_str_has_prefix (fabric, "ata_pata")) {
+                        ret = g_strdup ("PATA Host Adapter");
+                } else if (g_str_has_prefix (fabric, "ata_sata")) {
+                        ret = g_strdup ("SATA Host Adapter");
+                } else if (g_str_has_prefix (fabric, "ata")) {
+                        ret = g_strdup ("ATA Host Adapter");
+                } else if (g_str_has_prefix (fabric, "scsi_sas")) {
+                        ret = g_strdup ("SAS Host Adapter");
+                } else if (g_str_has_prefix (fabric, "scsi")) {
+                        ret = g_strdup ("SCSI Host Adapter");
+                } else {
+                        ret = g_strdup ("Host Adapter");
+                }
+
+        } else {
+                ret = g_strdup (_("SAS Expander"));
+        }
+
+        return ret;
 }
 
 static gchar *
@@ -164,9 +216,17 @@ gdu_hub_get_vpd_name (GduPresentable *presentable)
         const gchar *vendor;
         const gchar *model;
 
-        vendor = gdu_expander_get_vendor (hub->priv->expander);
-        model = gdu_expander_get_model (hub->priv->expander);
-        s = g_strdup_printf ("%s %s", vendor, model);
+        if (hub->priv->expander == NULL) {
+                vendor = gdu_adapter_get_vendor (hub->priv->adapter);
+                model = gdu_adapter_get_model (hub->priv->adapter);
+                //s = g_strdup_printf ("%s %s", vendor, model);
+                s = g_strdup (model);
+        } else {
+                vendor = gdu_expander_get_vendor (hub->priv->expander);
+                model = gdu_expander_get_model (hub->priv->expander);
+                s = g_strdup_printf ("%s %s", vendor, model);
+        }
+
         return s;
 }
 
@@ -201,7 +261,7 @@ static GduPool *
 gdu_hub_get_pool (GduPresentable *presentable)
 {
         GduHub *hub = GDU_HUB (presentable);
-        return gdu_expander_get_pool (hub->priv->expander);
+        return gdu_adapter_get_pool (hub->priv->adapter);
 }
 
 static gboolean
@@ -216,10 +276,16 @@ gdu_hub_is_recognized (GduPresentable *presentable)
         return FALSE;
 }
 
+GduAdapter *
+gdu_hub_get_adapter (GduHub *hub)
+{
+        return g_object_ref (hub->priv->adapter);
+}
+
 GduExpander *
 gdu_hub_get_expander (GduHub *hub)
 {
-        return g_object_ref (hub->priv->expander);
+        return hub->priv->expander != NULL ? g_object_ref (hub->priv->expander) : NULL;
 }
 
 static void
diff --git a/src/gdu/gdu-hub.h b/src/gdu/gdu-hub.h
index 8d65735..180e4cb 100644
--- a/src/gdu/gdu-hub.h
+++ b/src/gdu/gdu-hub.h
@@ -54,6 +54,7 @@ struct _GduHubClass
 };
 
 GType        gdu_hub_get_type     (void);
+GduAdapter  *gdu_hub_get_adapter  (GduHub *hub);
 GduExpander *gdu_hub_get_expander (GduHub *hub);
 
 G_END_DECLS
diff --git a/src/gdu/gdu-pool.c b/src/gdu/gdu-pool.c
index 5903374..e5c4719 100644
--- a/src/gdu/gdu-pool.c
+++ b/src/gdu/gdu-pool.c
@@ -34,7 +34,6 @@
 #include "gdu-linux-md-drive.h"
 #include "gdu-volume.h"
 #include "gdu-volume-hole.h"
-#include "gdu-hba.h"
 #include "gdu-hub.h"
 #include "gdu-known-filesystem.h"
 #include "gdu-private.h"
@@ -813,7 +812,7 @@ recompute_presentables (GduPool *pool)
         GList *removed_presentables;
         GHashTable *hash_map_from_drive_to_extended_partition;
         GHashTable *hash_map_from_linux_md_uuid_to_drive;
-        GHashTable *hash_map_from_adapter_objpath_to_hba;
+        GHashTable *hash_map_from_adapter_objpath_to_hub;
         GHashTable *hash_map_from_expander_objpath_to_hub;
 
         /* The general strategy for (re-)computing presentables is rather brute force; we
@@ -839,35 +838,39 @@ recompute_presentables (GduPool *pool)
                                                                       NULL,
                                                                       NULL);
 
-        hash_map_from_adapter_objpath_to_hba = g_hash_table_new_full (g_str_hash,
-                                                                         g_str_equal,
-                                                                         NULL,
-                                                                         NULL);
+        hash_map_from_adapter_objpath_to_hub = g_hash_table_new_full (g_str_hash,
+                                                                      g_str_equal,
+                                                                      NULL,
+                                                                      NULL);
 
         hash_map_from_expander_objpath_to_hub = g_hash_table_new_full (g_str_hash,
                                                                        g_str_equal,
                                                                        NULL,
                                                                        NULL);
 
-        /* First add all HBAs */
+        /* First add all HBAs as Hub objects */
         adapters = gdu_pool_get_adapters (pool);
         for (l = adapters; l != NULL; l = l->next) {
                 GduAdapter *adapter = GDU_ADAPTER (l->data);
-                GduHba *hba;
+                GduHub *hub;
 
-                hba = _gdu_hba_new_from_adapter (pool, adapter);
+                hub = _gdu_hub_new (pool,
+                                    adapter,
+                                    NULL,   /* expander */
+                                    NULL);  /* enclosing_presentable */
 
-                g_hash_table_insert (hash_map_from_adapter_objpath_to_hba,
+                g_hash_table_insert (hash_map_from_adapter_objpath_to_hub,
                                      (gpointer) gdu_adapter_get_object_path (adapter),
-                                     hba);
+                                     hub);
 
-                new_presentables = g_list_prepend (new_presentables, hba);
+                new_presentables = g_list_prepend (new_presentables, hub);
         } /* for all adapters */
 
         /* Then all expanders */
         expanders = gdu_pool_get_expanders (pool);
         for (l = expanders; l != NULL; l = l->next) {
                 GduExpander *expander = GDU_EXPANDER (l->data);
+                GduAdapter *adapter;
                 GduHub *hub;
                 gchar **port_object_paths;
                 GduPresentable *expander_parent;
@@ -888,15 +891,18 @@ recompute_presentables (GduPool *pool)
                         if (port != NULL) {
                                 const gchar *adapter_object_path;
                                 adapter_object_path = gdu_port_get_adapter (port);
-                                expander_parent = g_hash_table_lookup (hash_map_from_adapter_objpath_to_hba,
+                                adapter = gdu_pool_get_adapter_by_object_path (pool, adapter_object_path);
+                                expander_parent = g_hash_table_lookup (hash_map_from_adapter_objpath_to_hub,
                                                                        adapter_object_path);
                                 g_object_unref (port);
                         }
                 }
 
                 g_warn_if_fail (expander_parent != NULL);
+                g_warn_if_fail (adapter != NULL);
 
-                hub = _gdu_hub_new_from_expander (pool, expander, expander_parent);
+                hub = _gdu_hub_new (pool, adapter, expander, expander_parent);
+                g_object_unref (adapter);
 
                 g_hash_table_insert (hash_map_from_expander_objpath_to_hub,
                                      (gpointer) gdu_expander_get_object_path (expander),
@@ -955,9 +961,6 @@ recompute_presentables (GduPool *pool)
 
                         } else {
                                 GduPresentable *drive_parent;
-
-                                drive_parent = NULL;
-#if 1
                                 gchar **port_object_paths;
 
                                 /* we are guaranteed that upstream ports all stem from the same expander or
@@ -978,20 +981,12 @@ recompute_presentables (GduPool *pool)
                                                         drive_parent = g_hash_table_lookup (hash_map_from_expander_objpath_to_hub,
                                                                                             parent_object_path);
                                                 } else {
-                                                        drive_parent = g_hash_table_lookup (hash_map_from_adapter_objpath_to_hba,
+                                                        drive_parent = g_hash_table_lookup (hash_map_from_adapter_objpath_to_hub,
                                                                                             adapter_object_path);
                                                 }
                                                 g_object_unref (port);
                                         }
                                 }
-#else
-                                const gchar *adapter_objpath;
-
-                                adapter_objpath = gdu_device_drive_get_adapter (device);
-                                if (adapter_objpath != NULL)
-                                        drive_parent = g_hash_table_lookup (hash_map_from_adapter_objpath_to_hba,
-                                                                            adapter_objpath);
-#endif
 
                                 drive = _gdu_drive_new_from_device (pool, device, drive_parent);
                         }
@@ -1125,7 +1120,7 @@ recompute_presentables (GduPool *pool)
         g_list_free (new_partitioned_drives);
         g_hash_table_unref (hash_map_from_drive_to_extended_partition);
         g_hash_table_unref (hash_map_from_linux_md_uuid_to_drive);
-        g_hash_table_unref (hash_map_from_adapter_objpath_to_hba);
+        g_hash_table_unref (hash_map_from_adapter_objpath_to_hub);
         g_hash_table_unref (hash_map_from_expander_objpath_to_hub);
 
         /* figure out the diff */
diff --git a/src/gdu/gdu-private.h b/src/gdu/gdu-private.h
index 4306580..2127450 100644
--- a/src/gdu/gdu-private.h
+++ b/src/gdu/gdu-private.h
@@ -106,11 +106,14 @@ void        _gdu_device_job_changed           (GduDevice   *device,
 
 GduAdapter *_gdu_adapter_new_from_object_path (GduPool *pool, const char *object_path);
 gboolean    _gdu_adapter_changed              (GduAdapter   *adapter);
-GduHba     *_gdu_hba_new_from_adapter         (GduPool *pool, GduAdapter *adapter);
 
 GduExpander *_gdu_expander_new_from_object_path (GduPool *pool, const char *object_path);
-gboolean    _gdu_expander_changed              (GduExpander   *expander);
-GduHub      *_gdu_hub_new_from_expander         (GduPool *pool, GduExpander *expander, GduPresentable *enclosing_presentable);
+gboolean    _gdu_expander_changed               (GduExpander   *expander);
+
+GduHub     *_gdu_hub_new                        (GduPool        *pool,
+                                                 GduAdapter     *adapter,
+                                                 GduExpander    *expander,
+                                                 GduPresentable *enclosing_presentable);
 
 GduPort    *_gdu_port_new_from_object_path (GduPool *pool, const char *object_path);
 gboolean    _gdu_port_changed               (GduPort   *port);
diff --git a/src/gdu/gdu-types.h b/src/gdu/gdu-types.h
index 999b33a..d107d90 100644
--- a/src/gdu/gdu-types.h
+++ b/src/gdu/gdu-types.h
@@ -44,7 +44,6 @@ typedef struct _GduDrive                  GduDrive;
 typedef struct _GduLinuxMdDrive           GduLinuxMdDrive;
 typedef struct _GduVolume                 GduVolume;
 typedef struct _GduVolumeHole             GduVolumeHole;
-typedef struct _GduHba                    GduHba;
 typedef struct _GduHub                    GduHub;
 
 typedef struct _GduKnownFilesystem        GduKnownFilesystem;
diff --git a/src/gdu/gdu.h b/src/gdu/gdu.h
index cedf7e0..1dc0d88 100644
--- a/src/gdu/gdu.h
+++ b/src/gdu/gdu.h
@@ -43,7 +43,6 @@
 #include <gdu/gdu-util.h>
 #include <gdu/gdu-volume.h>
 #include <gdu/gdu-volume-hole.h>
-#include <gdu/gdu-hba.h>
 #include <gdu/gdu-hub.h>
 #include <gdu/gdu-callbacks.h>
 
diff --git a/src/palimpsest/Makefile.am b/src/palimpsest/Makefile.am
index 21776ec..ec8fdee 100644
--- a/src/palimpsest/Makefile.am
+++ b/src/palimpsest/Makefile.am
@@ -18,7 +18,6 @@ palimpsest_SOURCES = 									\
 	gdu-section-no-media.h			gdu-section-no-media.c			\
 	gdu-section-drive.h			gdu-section-drive.c			\
 	gdu-section-volumes.h			gdu-section-volumes.c			\
-	gdu-section-hba.h			gdu-section-hba.c			\
 	gdu-section-hub.h			gdu-section-hub.c			\
 	$(NULL)
 
diff --git a/src/palimpsest/gdu-section-hub.c b/src/palimpsest/gdu-section-hub.c
index 413ac81..82b2ac0 100644
--- a/src/palimpsest/gdu-section-hub.c
+++ b/src/palimpsest/gdu-section-hub.c
@@ -32,6 +32,7 @@
 
 struct _GduSectionHubPrivate
 {
+        GtkWidget *heading_label;
         GduDetailsElement *vendor_element;
         GduDetailsElement *model_element;
         GduDetailsElement *revision_element;
@@ -60,16 +61,19 @@ gdu_section_hub_update (GduSection *_section)
 {
         GduSectionHub *section = GDU_SECTION_HUB (_section);
         GduPresentable *p;
+        GduAdapter *a;
         GduExpander *e;
         GduPool *pool;
-        const gchar *adapter_object_path;
-        GduAdapter *a;
         const gchar *vendor;
         const gchar *model;
         const gchar *revision;
         const gchar *fabric;
+        const gchar *driver;
         guint num_ports;
         gchar *num_ports_str;
+        gchar *fabric_str;
+        gchar *s;
+        gchar *s2;
 
         a = NULL;
         e = NULL;
@@ -77,28 +81,71 @@ gdu_section_hub_update (GduSection *_section)
 
         p = gdu_section_get_presentable (_section);
 
+        a = gdu_hub_get_adapter (GDU_HUB (p));
         e = gdu_hub_get_expander (GDU_HUB (p));
-        if (e == NULL)
-                goto out;
 
-        pool = gdu_expander_get_pool (e);
+        pool = gdu_adapter_get_pool (a);
         if (pool == NULL)
                 goto out;
 
-        adapter_object_path = gdu_expander_get_adapter (e);
-        if (adapter_object_path != NULL) {
-                a = gdu_pool_get_adapter_by_object_path (pool, adapter_object_path);
-        }
+        if (e == NULL) {
 
-        vendor = gdu_expander_get_vendor (e);
-        model = gdu_expander_get_model (e);
-        revision = gdu_expander_get_revision (e);
-        fabric = NULL;
-        if (a != NULL)
+                vendor = gdu_adapter_get_vendor (a);
+                model = gdu_adapter_get_model (a);
+                driver = gdu_adapter_get_driver (a);
                 fabric = gdu_adapter_get_fabric (a);
-        num_ports = gdu_expander_get_num_ports (e);
+                num_ports = gdu_adapter_get_num_ports (a);
+
+                revision = "â??";
+        } else {
+                vendor = gdu_expander_get_vendor (e);
+                model = gdu_expander_get_model (e);
+                revision = gdu_expander_get_revision (e);
+                fabric = NULL;
+                if (a != NULL)
+                        fabric = gdu_adapter_get_fabric (a);
+                num_ports = gdu_expander_get_num_ports (e);
+
+                /* TODO: maybe move these blocks of code to gdu-util.c as util functions */
+
+                if (num_ports > 0) {
+                        if (g_strcmp0 (fabric, "scsi_sas") == 0) {
+                                /* Translators: Used for SAS to convey the number of PHYs in the
+                                 * "Number of Ports" element. You should probably not translate PHY.
+                                 */
+                                num_ports_str = g_strdup_printf (_("%d PHYs"), num_ports);
+                        } else {
+                                num_ports_str = g_strdup_printf ("%d", num_ports);
+                        }
+                } else {
+                        num_ports_str = g_strdup ("â??");
+                }
+
+                if (revision == NULL || strlen (revision) == 0)
+                        revision = "â??";
+
+                driver = "â??";
+        }
 
-        /* TODO: maybe move these blocks of code to gdu-util.c as util functions */
+        if (g_str_has_prefix (fabric, "ata_pata")) {
+                fabric_str = g_strdup ("Parallel ATA");
+        } else if (g_str_has_prefix (fabric, "ata_sata")) {
+                fabric_str = g_strdup ("Serial ATA");
+        } else if (g_str_has_prefix (fabric, "ata")) {
+                fabric_str = g_strdup ("ATA");
+        } else if (g_str_has_prefix (fabric, "scsi_sas")) {
+                fabric_str = g_strdup ("Serial Attached SCSI");
+        } else if (g_str_has_prefix (fabric, "scsi")) {
+                fabric_str = g_strdup ("SCSI");
+        } else {
+                fabric_str = g_strdup ("â??");
+        }
+
+        s = gdu_presentable_get_name (p);
+        s2 = g_strconcat ("<b>", s, "</b>", NULL);
+        gtk_label_set_markup (GTK_LABEL (section->priv->heading_label), s2);
+        g_free (s);
+        g_free (s2);
 
         if (num_ports > 0) {
                 if (g_strcmp0 (fabric, "scsi_sas") == 0) {
@@ -113,12 +160,11 @@ gdu_section_hub_update (GduSection *_section)
                 num_ports_str = g_strdup ("â??");
         }
 
-        if (revision == NULL || strlen (revision) == 0)
-                revision = "â??";
-
         gdu_details_element_set_text (section->priv->vendor_element, vendor);
         gdu_details_element_set_text (section->priv->model_element, model);
         gdu_details_element_set_text (section->priv->revision_element, revision);
+        gdu_details_element_set_text (section->priv->driver_element, driver);
+        gdu_details_element_set_text (section->priv->fabric_element, fabric_str);
         gdu_details_element_set_text (section->priv->num_ports_element, num_ports_str);
 
  out:
@@ -141,7 +187,6 @@ gdu_section_hub_constructed (GObject *object)
         GtkWidget *label;
         GtkWidget *table;
         GtkWidget *vbox;
-        gchar *s;
         GduPresentable *p;
         GduDevice *d;
         GPtrArray *elements;
@@ -156,10 +201,8 @@ gdu_section_hub_constructed (GObject *object)
 
         label = gtk_label_new (NULL);
         gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-        s = g_strconcat ("<b>", _("SAS Expander"), "</b>", NULL);
-        gtk_label_set_markup (GTK_LABEL (label), s);
-        g_free (s);
         gtk_box_pack_start (GTK_BOX (section), label, FALSE, FALSE, 0);
+        section->priv->heading_label = label;
 
         align = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
         gtk_alignment_set_padding (GTK_ALIGNMENT (align), 0, 0, 12, 0);
@@ -182,6 +225,14 @@ gdu_section_hub_constructed (GObject *object)
         g_ptr_array_add (elements, element);
         section->priv->revision_element = element;
 
+        element = gdu_details_element_new (_("Driver:"), NULL, NULL);
+        g_ptr_array_add (elements, element);
+        section->priv->driver_element = element;
+
+        element = gdu_details_element_new (_("Fabric:"), NULL, NULL);
+        g_ptr_array_add (elements, element);
+        section->priv->fabric_element = element;
+
         element = gdu_details_element_new (_("Number of Ports:"), NULL, NULL);
         g_ptr_array_add (elements, element);
         section->priv->num_ports_element = element;
diff --git a/src/palimpsest/gdu-shell.c b/src/palimpsest/gdu-shell.c
index 73d84da..2dbfba2 100644
--- a/src/palimpsest/gdu-shell.c
+++ b/src/palimpsest/gdu-shell.c
@@ -45,7 +45,6 @@
 #include "gdu-section-no-media.h"
 #include "gdu-section-drive.h"
 #include "gdu-section-volumes.h"
-#include "gdu-section-hba.h"
 #include "gdu-section-hub.h"
 
 struct _GduShellPrivate
@@ -206,11 +205,7 @@ compute_sections_to_show (GduShell *shell)
         sections_to_show = NULL;
         device = gdu_presentable_get_device (shell->priv->presentable_now_showing);
 
-        if (GDU_IS_HBA (shell->priv->presentable_now_showing)) {
-
-                sections_to_show = g_list_append (sections_to_show, (gpointer) GDU_TYPE_SECTION_HBA);
-
-        } else if (GDU_IS_HUB (shell->priv->presentable_now_showing)) {
+        if (GDU_IS_HUB (shell->priv->presentable_now_showing)) {
 
                 sections_to_show = g_list_append (sections_to_show, (gpointer) GDU_TYPE_SECTION_HUB);
 



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