[gnome-disk-utility/udisks2-port] Don't show "Configuration" for device



commit a2ade7b2269e2bc8ce65bc1f8efe18fc4c5fb0a2
Author: David Zeuthen <davidz redhat com>
Date:   Thu Jan 5 14:32:25 2012 -0500

    Don't show "Configuration" for device
    
    It's redudant since we already show a star (user-bookmarks-symbolic)
    in the volume grid to convey this.
    
    Signed-off-by: David Zeuthen <davidz redhat com>

 data/ui/palimpsest.ui      |   39 +----------
 src/palimpsest/gduwindow.c |  170 --------------------------------------------
 2 files changed, 1 insertions(+), 208 deletions(-)
---
diff --git a/data/ui/palimpsest.ui b/data/ui/palimpsest.ui
index a1e7854..a49cdbe 100644
--- a/data/ui/palimpsest.ui
+++ b/data/ui/palimpsest.ui
@@ -865,7 +865,7 @@
                           <object class="GtkTable" id="devtab-table">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="n_rows">7</property>
+                            <property name="n_rows">6</property>
                             <property name="n_columns">2</property>
                             <property name="column_spacing">10</property>
                             <child>
@@ -1086,43 +1086,6 @@
                                 <property name="y_padding">4</property>
                               </packing>
                             </child>
-                            <child>
-                              <object class="GtkLabel" id="devtab-volume-configured-label">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="xalign">1</property>
-                                <property name="label" translatable="yes">Configured</property>
-                                <attributes>
-                                  <attribute name="foreground" value="#555555555555"/>
-                                </attributes>
-                              </object>
-                              <packing>
-                                <property name="top_attach">6</property>
-                                <property name="bottom_attach">7</property>
-                                <property name="x_options">GTK_FILL</property>
-                                <property name="y_options"></property>
-                                <property name="y_padding">4</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="devtab-volume-configured-value-label">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="hexpand">True</property>
-                                <property name="xalign">0</property>
-                                <property name="selectable">True</property>
-                                <property name="ellipsize">end</property>
-                              </object>
-                              <packing>
-                                <property name="left_attach">1</property>
-                                <property name="right_attach">2</property>
-                                <property name="top_attach">6</property>
-                                <property name="bottom_attach">7</property>
-                                <property name="x_options">GTK_FILL</property>
-                                <property name="y_options"></property>
-                                <property name="y_padding">4</property>
-                              </packing>
-                            </child>
                           </object>
                           <packing>
                             <property name="expand">False</property>
diff --git a/src/palimpsest/gduwindow.c b/src/palimpsest/gduwindow.c
index 9be141d..c7fa096 100644
--- a/src/palimpsest/gduwindow.c
+++ b/src/palimpsest/gduwindow.c
@@ -1665,166 +1665,6 @@ lookup_cleartext_device_for_crypto_device (UDisksClient  *client,
   return ret;
 }
 
-static gboolean
-options_has (const gchar *options, const gchar *str)
-{
-  gboolean ret = FALSE;
-  gchar **tokens;
-  guint n;
-
-  tokens = g_strsplit (options, ",", 0);
-  for (n = 0; tokens != NULL && tokens[n] != NULL; n++)
-    {
-      if (g_strcmp0 (tokens[n], str) == 0)
-        {
-          ret = TRUE;
-          goto out;
-        }
-    }
- out:
-  g_strfreev (tokens);
-  return ret;
-}
-
-static gchar *
-calculate_configuration_for_display (UDisksBlock *block,
-                                     guint        show_flags)
-{
-  GString *str;
-  GVariantIter iter;
-  const gchar *type;
-  GVariant *details;
-  gboolean mentioned_fstab = FALSE;
-  gboolean mentioned_crypttab = FALSE;
-  gchar *ret;
-  const gchar *options;
-
-  ret = NULL;
-
-  /* TODO: could include more details such as whether the
-   * device is activated at boot time
-   */
-
-  str = g_string_new (NULL);
-  g_variant_iter_init (&iter, udisks_block_get_configuration (block));
-  while (g_variant_iter_next (&iter, "(&s a{sv})", &type, &details))
-    {
-      if (g_strcmp0 (type, "fstab") == 0)
-        {
-          if (!mentioned_fstab)
-            {
-              mentioned_fstab = TRUE;
-              if (str->len > 0)
-                g_string_append (str, ", ");
-              if (!g_variant_lookup (details, "opts", "^&ay", &options))
-                options = "";
-              if (options_has (options, "noauto"))
-                {
-                  if (g_strcmp0 (udisks_block_get_id_usage (block), "other") == 0 &&
-                      g_strcmp0 (udisks_block_get_id_type (block), "swap") == 0)
-                    {
-                      /* Translators: Shown when the device is configured in /etc/fstab
-                       * is a swap device but not automatically mounted at boot time.
-                       * This string is shown next to the label "Configured".
-                       */
-                      g_string_append (str, _("Yes (not activated at system startup)"));
-                    }
-                  else
-                    {
-                      /* Translators: Shown when the device is configured in /etc/fstab
-                       * but not automatically mounted at boot time.
-                       * This string is shown next to the label "Configured".
-                       */
-                      g_string_append (str, _("Yes (not mounted at system startup)"));
-                    }
-                }
-              else
-                {
-                  if (g_strcmp0 (udisks_block_get_id_usage (block), "other") == 0 &&
-                      g_strcmp0 (udisks_block_get_id_type (block), "swap") == 0)
-                    {
-                      /* Translators: Shown when the device is configured in /etc/fstab
-                       * is a swap device and automatically activated at boot time.
-                       * This string is shown next to the label "Configured".
-                       */
-                      g_string_append (str, _("Yes (activated at system startup)"));
-                    }
-                  else
-                    {
-                      /* Translators: Shown when the device is configured in /etc/fstab
-                       * and automatically mounted at boot time.
-                       * This string is shown next to the label "Configured".
-                       */
-                      g_string_append (str, _("Yes (mounted at system startup)"));
-                    }
-                }
-            }
-        }
-      else if (g_strcmp0 (type, "crypttab") == 0)
-        {
-          if (!mentioned_crypttab)
-            {
-              mentioned_crypttab = TRUE;
-              if (str->len > 0)
-                g_string_append (str, ", ");
-              if (!g_variant_lookup (details, "options", "^&ay", &options))
-                options = "";
-              if (options_has (options, "noauto"))
-                {
-                  /* Translators: Shown when the device is configured in /etc/crypttab
-                   * but not automatically unlocked at boot time.
-                   * This string is shown next to the label "Configured".
-                   */
-                  g_string_append (str, _("Yes (not unlocked at system startup)"));
-                }
-              else
-                {
-                  /* Translators: Shown when the device is configured in /etc/crypttab
-                   * but not automatically unlocked at boot time.
-                   * This string is shown next to the label "Configured".
-                   */
-                  g_string_append (str, _("Yes (unlocked at system startup)"));
-                }
-            }
-        }
-      else
-        {
-          if (str->len > 0)
-            g_string_append (str, ", ");
-          g_string_append (str, type);
-        }
-      g_variant_unref (details);
-    }
-
-  if (str->len == 0)
-    {
-      UDisksObject *object;
-
-      /* No known configuration... show "No" only if we actually
-       * know how to configure the device or already offer to
-       * configure the device...
-       */
-      object = UDISKS_OBJECT (g_dbus_interface_get_object (G_DBUS_INTERFACE (block)));
-      if (udisks_object_peek_filesystem (object) != NULL ||
-          udisks_object_peek_swapspace (object) != NULL ||
-          udisks_object_peek_encrypted (object) != NULL ||
-          show_flags & (SHOW_FLAGS_POPUP_MENU_CONFIGURE_FSTAB | SHOW_FLAGS_POPUP_MENU_CONFIGURE_CRYPTTAB))
-        {
-          /* Translators: Shown when the device is not configured */
-          g_string_append (str, _("No"));
-        }
-      else
-        {
-          g_string_free (str, TRUE);
-          goto out;
-        }
-    }
-
-  ret = g_string_free (str, FALSE);
- out:
-  return ret;
-}
-
 static gchar *
 get_device_file_for_display (UDisksBlock *block)
 {
@@ -2097,16 +1937,6 @@ update_device_page_for_block (GduWindow          *window,
       *show_flags |= SHOW_FLAGS_POPUP_MENU_CONFIGURE_CRYPTTAB;
       *show_flags |= SHOW_FLAGS_POPUP_MENU_CHANGE_PASSPHRASE;
     }
-
-  s = calculate_configuration_for_display (block, *show_flags);
-  if (s != NULL)
-    {
-      set_markup (window,
-                  "devtab-volume-configured-label",
-                  "devtab-volume-configured-value-label",
-                  s, SET_MARKUP_FLAGS_HYPHEN_IF_EMPTY);
-      g_free (s);
-    }
 }
 
 static void



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