[gnome-disk-utility] Rename GduEditFilesystemDialog to GduEditNameDialog and generalize



commit 90f0d8338d160e5bcedef181b19cee255e9549eb
Author: David Zeuthen <davidz redhat com>
Date:   Tue Jan 12 07:09:41 2010 -0500

    Rename GduEditFilesystemDialog to GduEditNameDialog and generalize

 src/gdu-gtk/Makefile.am                  |    4 +-
 src/gdu-gtk/gdu-edit-filesystem-dialog.c |  265 ----------------------
 src/gdu-gtk/gdu-edit-filesystem-dialog.h |   64 ------
 src/gdu-gtk/gdu-edit-name-dialog.c       |  363 ++++++++++++++++++++++++++++++
 src/gdu-gtk/gdu-edit-name-dialog.h       |   70 ++++++
 src/gdu-gtk/gdu-gtk-types.h              |    2 +-
 src/gdu-gtk/gdu-gtk.h                    |    2 +-
 src/palimpsest/gdu-section-volumes.c     |   31 +++-
 8 files changed, 466 insertions(+), 335 deletions(-)
---
diff --git a/src/gdu-gtk/Makefile.am b/src/gdu-gtk/Makefile.am
index 59cc788..2002b02 100644
--- a/src/gdu-gtk/Makefile.am
+++ b/src/gdu-gtk/Makefile.am
@@ -49,7 +49,7 @@ libgdu_gtkinclude_HEADERS =              				\
 	gdu-format-dialog.h						\
 	gdu-partition-dialog.h						\
 	gdu-create-partition-dialog.h					\
-	gdu-edit-filesystem-dialog.h					\
+	gdu-edit-name-dialog.h						\
 	gdu-disk-selection-widget.h					\
 	gdu-add-component-linux-md-dialog.h				\
 	gdu-edit-linux-md-dialog.h					\
@@ -81,7 +81,7 @@ libgdu_gtk_la_SOURCES =                 	               				\
 	gdu-format-dialog.h			gdu-format-dialog.c			\
 	gdu-partition-dialog.h			gdu-partition-dialog.c			\
 	gdu-create-partition-dialog.h		gdu-create-partition-dialog.c		\
-	gdu-edit-filesystem-dialog.h		gdu-edit-filesystem-dialog.c		\
+	gdu-edit-name-dialog.h			gdu-edit-name-dialog.c			\
 	gdu-disk-selection-widget.h		gdu-disk-selection-widget.c		\
 	gdu-add-component-linux-md-dialog.h	gdu-add-component-linux-md-dialog.c	\
 	gdu-edit-linux-md-dialog.h		gdu-edit-linux-md-dialog.c		\
diff --git a/src/gdu-gtk/gdu-edit-name-dialog.c b/src/gdu-gtk/gdu-edit-name-dialog.c
new file mode 100644
index 0000000..8fb70aa
--- /dev/null
+++ b/src/gdu-gtk/gdu-edit-name-dialog.c
@@ -0,0 +1,363 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+/* gdu-edit-name-dialog.c
+ *
+ * Copyright (C) 2009 David Zeuthen
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#include "config.h"
+#include <glib/gi18n-lib.h>
+
+#include <atasmart.h>
+#include <glib/gstdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+
+#include "gdu-gtk.h"
+#include "gdu-edit-name-dialog.h"
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+struct GduEditNameDialogPrivate
+{
+        gchar *orig_name;
+        GtkWidget *name_entry;
+        guint name_max_bytes;
+
+        gchar *message;
+        gchar *entry_mnemonic;
+};
+
+enum {
+        PROP_0,
+        PROP_NAME,
+        PROP_NAME_MAX_BYTES,
+        PROP_MESSAGE,
+        PROP_ENTRY_MNEMONIC,
+};
+
+G_DEFINE_TYPE (GduEditNameDialog, gdu_edit_name_dialog, GDU_TYPE_DIALOG)
+
+static void
+gdu_edit_name_dialog_finalize (GObject *object)
+{
+        GduEditNameDialog *dialog = GDU_EDIT_NAME_DIALOG (object);
+
+        g_free (dialog->priv->orig_name);
+        g_free (dialog->priv->message);
+        g_free (dialog->priv->entry_mnemonic);
+
+        if (G_OBJECT_CLASS (gdu_edit_name_dialog_parent_class)->finalize != NULL)
+                G_OBJECT_CLASS (gdu_edit_name_dialog_parent_class)->finalize (object);
+}
+
+static void
+gdu_edit_name_dialog_get_property (GObject    *object,
+                                   guint       property_id,
+                                   GValue     *value,
+                                   GParamSpec *pspec)
+{
+        GduEditNameDialog *dialog = GDU_EDIT_NAME_DIALOG (object);
+
+        switch (property_id) {
+        case PROP_NAME:
+                g_value_take_string (value, gdu_edit_name_dialog_get_name (dialog));
+                break;
+
+        case PROP_NAME_MAX_BYTES:
+                g_value_set_uint (value, dialog->priv->name_max_bytes);
+                break;
+
+        case PROP_MESSAGE:
+                g_value_set_string (value, dialog->priv->message);
+                break;
+
+        case PROP_ENTRY_MNEMONIC:
+                g_value_set_string (value, dialog->priv->entry_mnemonic);
+                break;
+
+        default:
+                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+                break;
+        }
+}
+
+static void
+gdu_edit_name_dialog_set_property (GObject      *object,
+                                   guint         property_id,
+                                   const GValue *value,
+                                   GParamSpec   *pspec)
+{
+        GduEditNameDialog *dialog = GDU_EDIT_NAME_DIALOG (object);
+
+        switch (property_id) {
+        case PROP_NAME:
+                gdu_edit_name_dialog_set_name (dialog, g_value_get_string (value));
+                break;
+
+        case PROP_NAME_MAX_BYTES:
+                dialog->priv->name_max_bytes = g_value_get_uint (value);
+                gtk_entry_set_max_length (GTK_ENTRY (dialog->priv->name_entry), dialog->priv->name_max_bytes);
+                break;
+
+        case PROP_MESSAGE:
+                dialog->priv->message = g_value_dup_string (value);
+                break;
+
+        case PROP_ENTRY_MNEMONIC:
+                dialog->priv->entry_mnemonic = g_value_dup_string (value);
+                break;
+
+        default:
+                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+                break;
+        }
+}
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static void
+update_apply_sensitivity (GduEditNameDialog *dialog)
+{
+        gboolean name_differ;
+
+        name_differ = FALSE;
+
+        if (g_strcmp0 (dialog->priv->orig_name, gtk_entry_get_text (GTK_ENTRY (dialog->priv->name_entry))) != 0) {
+                name_differ = TRUE;
+        }
+
+        if (name_differ) {
+                gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_APPLY, TRUE);
+        } else {
+                gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_APPLY, FALSE);
+        }
+}
+
+static void
+update (GduEditNameDialog *dialog)
+{
+        update_apply_sensitivity (dialog);
+}
+
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static void
+name_entry_changed (GtkWidget *combo_box,
+                     gpointer   user_data)
+{
+        GduEditNameDialog *dialog = GDU_EDIT_NAME_DIALOG (user_data);
+        update_apply_sensitivity (dialog);
+}
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static void
+gdu_edit_name_dialog_constructed (GObject *object)
+{
+        GduEditNameDialog *dialog = GDU_EDIT_NAME_DIALOG (object);
+        GtkWidget *content_area;
+        GtkWidget *hbox;
+        GtkWidget *vbox;
+        GtkWidget *image;
+        GtkWidget *label;
+        gchar *s;
+        gchar *s2;
+        GIcon *icon;
+        GtkWidget *table;
+        gint row;
+
+        gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
+        gtk_container_set_border_width (GTK_CONTAINER (dialog), 12);
+
+        gtk_dialog_add_button (GTK_DIALOG (dialog),
+                               GTK_STOCK_CANCEL,
+                               GTK_RESPONSE_CANCEL);
+
+        gtk_dialog_add_button (GTK_DIALOG (dialog),
+                               GTK_STOCK_APPLY,
+                               GTK_RESPONSE_APPLY);
+
+        content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+
+        icon = gdu_presentable_get_icon (gdu_dialog_get_presentable (GDU_DIALOG (dialog)));
+
+        hbox = gtk_hbox_new (FALSE, 12);
+        gtk_box_pack_start (GTK_BOX (content_area), hbox, TRUE, TRUE, 0);
+
+        image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_DIALOG);
+        gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0);
+        gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
+
+        vbox = gtk_vbox_new (FALSE, 12);
+        gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0);
+
+        s2 = gdu_presentable_get_vpd_name (gdu_dialog_get_presentable (GDU_DIALOG (dialog)));
+        s = g_strdup_printf (_("Edit %s"), s2);
+        gtk_window_set_title (GTK_WINDOW (dialog), s);
+        g_free (s);
+        g_free (s2);
+
+        /* --- */
+
+        label = gtk_label_new (NULL);
+        gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+        gtk_label_set_markup (GTK_LABEL (label), dialog->priv->message);
+        gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+
+        /* --- */
+
+        table = gtk_table_new (2, 2, FALSE);
+        gtk_table_set_col_spacings (GTK_TABLE (table), 12);
+        gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
+
+        row = 0;
+
+        label = gtk_label_new (NULL);
+        gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+        gtk_label_set_markup_with_mnemonic (GTK_LABEL (label), dialog->priv->entry_mnemonic);
+        gtk_table_attach (GTK_TABLE (table), label, 0, 1, row, row + 1,
+                          GTK_FILL, GTK_EXPAND | GTK_FILL, 2, 2);
+        gtk_table_attach (GTK_TABLE (table), dialog->priv->name_entry, 1, 2, row, row + 1,
+                          GTK_FILL, GTK_EXPAND | GTK_FILL, 2, 2);
+        gtk_label_set_mnemonic_widget (GTK_LABEL (label), dialog->priv->name_entry);
+        row++;
+
+        /* --- */
+
+
+        g_signal_connect (dialog->priv->name_entry,
+                          "changed",
+                          G_CALLBACK (name_entry_changed),
+                          dialog);
+
+        g_object_unref (icon);
+
+        update (dialog);
+
+        if (G_OBJECT_CLASS (gdu_edit_name_dialog_parent_class)->constructed != NULL)
+                G_OBJECT_CLASS (gdu_edit_name_dialog_parent_class)->constructed (object);
+}
+
+static void
+gdu_edit_name_dialog_class_init (GduEditNameDialogClass *klass)
+{
+        GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+        g_type_class_add_private (klass, sizeof (GduEditNameDialogPrivate));
+
+        object_class->get_property = gdu_edit_name_dialog_get_property;
+        object_class->set_property = gdu_edit_name_dialog_set_property;
+        object_class->constructed  = gdu_edit_name_dialog_constructed;
+        object_class->finalize     = gdu_edit_name_dialog_finalize;
+
+        g_object_class_install_property (object_class,
+                                         PROP_NAME,
+                                         g_param_spec_string ("name",
+                                                              NULL,
+                                                              NULL,
+                                                              NULL,
+                                                              G_PARAM_READABLE |
+                                                              G_PARAM_WRITABLE |
+                                                              G_PARAM_STATIC_STRINGS));
+
+        g_object_class_install_property (object_class,
+                                         PROP_NAME_MAX_BYTES,
+                                         g_param_spec_uint ("name-max-bytes",
+                                                            NULL,
+                                                            NULL,
+                                                            0,
+                                                            G_MAXUINT,
+                                                            G_MAXUINT,
+                                                            G_PARAM_READABLE |
+                                                            G_PARAM_WRITABLE |
+                                                            G_PARAM_CONSTRUCT_ONLY |
+                                                            G_PARAM_STATIC_STRINGS));
+
+        g_object_class_install_property (object_class,
+                                         PROP_MESSAGE,
+                                         g_param_spec_string ("message",
+                                                              NULL,
+                                                              NULL,
+                                                              NULL,
+                                                              G_PARAM_READABLE |
+                                                              G_PARAM_WRITABLE |
+                                                              G_PARAM_CONSTRUCT_ONLY |
+                                                              G_PARAM_STATIC_STRINGS));
+
+        g_object_class_install_property (object_class,
+                                         PROP_ENTRY_MNEMONIC,
+                                         g_param_spec_string ("entry-mnemonic",
+                                                              NULL,
+                                                              NULL,
+                                                              NULL,
+                                                              G_PARAM_READABLE |
+                                                              G_PARAM_WRITABLE |
+                                                              G_PARAM_CONSTRUCT_ONLY |
+                                                              G_PARAM_STATIC_STRINGS));
+}
+
+static void
+gdu_edit_name_dialog_init (GduEditNameDialog *dialog)
+{
+        dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (dialog,
+                                                    GDU_TYPE_EDIT_NAME_DIALOG,
+                                                    GduEditNameDialogPrivate);
+
+        dialog->priv->name_entry = gtk_entry_new ();
+}
+
+GtkWidget *
+gdu_edit_name_dialog_new (GtkWindow        *parent,
+                          GduPresentable   *presentable,
+                          const gchar      *name,
+                          guint             name_max_bytes,
+                          const gchar      *message,
+                          const gchar      *entry_mnemonic)
+{
+        g_return_val_if_fail (GDU_IS_PRESENTABLE (presentable), NULL);
+        return GTK_WIDGET (g_object_new (GDU_TYPE_EDIT_NAME_DIALOG,
+                                         "transient-for", parent,
+                                         "presentable", presentable,
+                                         "name", name,
+                                         "name-max-bytes", name_max_bytes,
+                                         "message", message,
+                                         "entry-mnemonic", entry_mnemonic,
+                                         NULL));
+}
+
+gchar *
+gdu_edit_name_dialog_get_name (GduEditNameDialog *dialog)
+{
+        g_return_val_if_fail (GDU_IS_EDIT_NAME_DIALOG (dialog), NULL);
+        return g_strdup (gtk_entry_get_text (GTK_ENTRY (dialog->priv->name_entry)));
+}
+
+void
+gdu_edit_name_dialog_set_name (GduEditNameDialog *dialog,
+                               const gchar       *name)
+{
+        g_return_if_fail (GDU_IS_EDIT_NAME_DIALOG (dialog));
+        gtk_entry_set_text (GTK_ENTRY (dialog->priv->name_entry), name);
+        g_free (dialog->priv->orig_name);
+        dialog->priv->orig_name = g_strdup (name);
+        update_apply_sensitivity (dialog);
+}
+
diff --git a/src/gdu-gtk/gdu-edit-name-dialog.h b/src/gdu-gtk/gdu-edit-name-dialog.h
new file mode 100644
index 0000000..bb234af
--- /dev/null
+++ b/src/gdu-gtk/gdu-edit-name-dialog.h
@@ -0,0 +1,70 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+/* gdu-edit-name-dialog.h
+ *
+ * Copyright (C) 2009 David Zeuthen
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#if !defined (__GDU_GTK_INSIDE_GDU_GTK_H) && !defined (GDU_GTK_COMPILATION)
+#error "Only <gdu-gtk/gdu-gtk.h> can be included directly, this file may disappear or change contents."
+#endif
+
+#ifndef __GDU_EDIT_NAME_DIALOG_H
+#define __GDU_EDIT_NAME_DIALOG_H
+
+#include <gdu-gtk/gdu-gtk-types.h>
+#include <gdu-gtk/gdu-dialog.h>
+
+G_BEGIN_DECLS
+
+#define GDU_TYPE_EDIT_NAME_DIALOG            gdu_edit_name_dialog_get_type()
+#define GDU_EDIT_NAME_DIALOG(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDU_TYPE_EDIT_NAME_DIALOG, GduEditNameDialog))
+#define GDU_EDIT_NAME_DIALOG_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GDU_TYPE_EDIT_NAME_DIALOG, GduEditNameDialogClass))
+#define GDU_IS_EDIT_NAME_DIALOG(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDU_TYPE_EDIT_NAME_DIALOG))
+#define GDU_IS_EDIT_NAME_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDU_TYPE_EDIT_NAME_DIALOG))
+#define GDU_EDIT_NAME_DIALOG_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GDU_TYPE_EDIT_NAME_DIALOG, GduEditNameDialogClass))
+
+typedef struct GduEditNameDialogClass   GduEditNameDialogClass;
+typedef struct GduEditNameDialogPrivate GduEditNameDialogPrivate;
+
+struct GduEditNameDialog
+{
+        GduDialog parent;
+
+        /*< private >*/
+        GduEditNameDialogPrivate *priv;
+};
+
+struct GduEditNameDialogClass
+{
+        GduDialogClass parent_class;
+};
+
+GType         gdu_edit_name_dialog_get_type  (void) G_GNUC_CONST;
+GtkWidget    *gdu_edit_name_dialog_new       (GtkWindow        *parent,
+                                              GduPresentable   *presentable,
+                                              const gchar      *name,
+                                              guint             name_max_bytes,
+                                              const gchar      *message,
+                                              const gchar      *entry_mnemonic);
+gchar        *gdu_edit_name_dialog_get_name (GduEditNameDialog *dialog);
+void          gdu_edit_name_dialog_set_name (GduEditNameDialog *dialog,
+                                             const gchar       *name);
+
+G_END_DECLS
+
+#endif /* __GDU_EDIT_NAME_DIALOG_H */
diff --git a/src/gdu-gtk/gdu-gtk-types.h b/src/gdu-gtk/gdu-gtk-types.h
index e2f97d7..f10d032 100644
--- a/src/gdu-gtk/gdu-gtk-types.h
+++ b/src/gdu-gtk/gdu-gtk-types.h
@@ -56,7 +56,7 @@ typedef struct GduEditPartitionDialog       GduEditPartitionDialog;
 typedef struct GduFormatDialog              GduFormatDialog;
 typedef struct GduPartitionDialog           GduPartitionDialog;
 typedef struct GduCreatePartitionDialog     GduCreatePartitionDialog;
-typedef struct GduEditFilesystemDialog      GduEditFilesystemDialog;
+typedef struct GduEditNameDialog            GduEditNameDialog;
 typedef struct GduDiskSelectionWidget       GduDiskSelectionWidget;
 typedef struct GduAddComponentLinuxMdDialog GduAddComponentLinuxMdDialog;
 typedef struct GduEditLinuxMdDialog         GduEditLinuxMdDialog;
diff --git a/src/gdu-gtk/gdu-gtk.h b/src/gdu-gtk/gdu-gtk.h
index e04f6bc..65aef65 100644
--- a/src/gdu-gtk/gdu-gtk.h
+++ b/src/gdu-gtk/gdu-gtk.h
@@ -48,7 +48,7 @@
 #include <gdu-gtk/gdu-format-dialog.h>
 #include <gdu-gtk/gdu-partition-dialog.h>
 #include <gdu-gtk/gdu-create-partition-dialog.h>
-#include <gdu-gtk/gdu-edit-filesystem-dialog.h>
+#include <gdu-gtk/gdu-edit-name-dialog.h>
 #include <gdu-gtk/gdu-disk-selection-widget.h>
 #include <gdu-gtk/gdu-add-component-linux-md-dialog.h>
 #include <gdu-gtk/gdu-edit-linux-md-dialog.h>
diff --git a/src/palimpsest/gdu-section-volumes.c b/src/palimpsest/gdu-section-volumes.c
index ff33248..3768dab 100644
--- a/src/palimpsest/gdu-section-volumes.c
+++ b/src/palimpsest/gdu-section-volumes.c
@@ -1147,11 +1147,18 @@ on_fs_change_label_button_clicked (GduButtonElement *button_element,
         GduSectionVolumes *section = GDU_SECTION_VOLUMES (user_data);
         GduPresentable *v;
         GduDevice *d;
+        GduPool *pool;
         GtkWindow *toplevel;
         GtkWidget *dialog;
         gint response;
+        GduKnownFilesystem *kfs;
+        const gchar *label;
+        guint label_max_bytes;
 
         v = NULL;
+        kfs = NULL;
+        pool = NULL;
+        d = NULL;
 
         v = gdu_volume_grid_get_selected (GDU_VOLUME_GRID (section->priv->grid));
         if (v == NULL)
@@ -1161,14 +1168,30 @@ on_fs_change_label_button_clicked (GduButtonElement *button_element,
         if (d == NULL)
                 goto out;
 
+        pool = gdu_device_get_pool (d);
+
+        kfs = gdu_pool_get_known_filesystem_by_id (pool, gdu_device_id_get_type (d));
+
+        label = gdu_device_id_get_label (d);
+        if (kfs != NULL) {
+                label_max_bytes = gdu_known_filesystem_get_max_label_len (kfs);
+        } else {
+                label_max_bytes = G_MAXUINT;
+        }
+
         toplevel = GTK_WINDOW (gdu_shell_get_toplevel (gdu_section_get_shell (GDU_SECTION (section))));
-        dialog = gdu_edit_filesystem_dialog_new (toplevel, v);
+        dialog = gdu_edit_name_dialog_new (toplevel,
+                                           v,
+                                           label,
+                                           label_max_bytes,
+                                           _("Choose a new filesystem label."),
+                                           _("_Label:"));
         gtk_widget_show_all (dialog);
         response = gtk_dialog_run (GTK_DIALOG (dialog));
         if (response == GTK_RESPONSE_APPLY) {
                 gchar *label;
 
-                label = gdu_edit_filesystem_dialog_get_label (GDU_EDIT_FILESYSTEM_DIALOG (dialog));
+                label = gdu_edit_name_dialog_get_name (GDU_EDIT_NAME_DIALOG (dialog));
 
                 gdu_device_op_filesystem_set_label (d,
                                                     label,
@@ -1184,6 +1207,10 @@ on_fs_change_label_button_clicked (GduButtonElement *button_element,
                 g_object_unref (d);
         if (v != NULL)
                 g_object_unref (v);
+        if (pool != NULL)
+                g_object_unref (pool);
+        if (kfs != NULL)
+                g_object_unref (kfs);
 }
 
 /* ---------------------------------------------------------------------------------------------------- */



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