[gnome-disk-utility] disks: Fix deprecation and other warnings



commit 38c3231c5c18cf3a713a9cc444f20a9568705a11
Author: David Zeuthen <zeuthen gmail com>
Date:   Sun Jan 19 23:26:39 2014 -0800

    disks: Fix deprecation and other warnings
    
    Signed-off-by: David Zeuthen <zeuthen gmail com>

 src/disks/gducreatediskimagedialog.c  |    2 +-
 src/disks/gducreatefilesystemwidget.c |    6 +++---
 src/disks/gdupasswordstrengthwidget.c |    6 +++---
 src/disks/gduvolumegrid.c             |   13 +++----------
 src/disks/gduwindow.c                 |    2 +-
 5 files changed, 11 insertions(+), 18 deletions(-)
---
diff --git a/src/disks/gducreatediskimagedialog.c b/src/disks/gducreatediskimagedialog.c
index b7cf350..643e17b 100644
--- a/src/disks/gducreatediskimagedialog.c
+++ b/src/disks/gducreatediskimagedialog.c
@@ -928,7 +928,7 @@ check_overwrite (DialogData *data)
   gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
                                             _("The file already exists in ā€œ%sā€.  Replacing it will overwrite 
its contents."),
                                             g_file_info_get_display_name (folder_info));
-  gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
+  gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Cancel"), GTK_RESPONSE_CANCEL);
   gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Replace"), GTK_RESPONSE_ACCEPT);
   gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
                                            GTK_RESPONSE_ACCEPT,
diff --git a/src/disks/gducreatefilesystemwidget.c b/src/disks/gducreatefilesystemwidget.c
index b8b4f84..48a982e 100644
--- a/src/disks/gducreatefilesystemwidget.c
+++ b/src/disks/gducreatefilesystemwidget.c
@@ -23,7 +23,7 @@
 typedef struct _GduCreateFilesystemWidgetClass GduCreateFilesystemWidgetClass;
 struct _GduCreateFilesystemWidget
 {
-  GtkVBox parent;
+  GtkBox parent;
 
   GduApplication  *application;
   UDisksDrive     *drive;
@@ -53,7 +53,7 @@ struct _GduCreateFilesystemWidget
 
 struct _GduCreateFilesystemWidgetClass
 {
-  GtkVBoxClass parent_class;
+  GtkBoxClass parent_class;
 };
 
 enum
@@ -76,7 +76,7 @@ enum
   MODEL_N_COLUMNS,
 };
 
-G_DEFINE_TYPE (GduCreateFilesystemWidget, gdu_create_filesystem_widget, GTK_TYPE_VBOX)
+G_DEFINE_TYPE (GduCreateFilesystemWidget, gdu_create_filesystem_widget, GTK_TYPE_BOX)
 
 static void
 gdu_create_filesystem_widget_finalize (GObject *object)
diff --git a/src/disks/gdupasswordstrengthwidget.c b/src/disks/gdupasswordstrengthwidget.c
index e1de8dc..985cb4c 100644
--- a/src/disks/gdupasswordstrengthwidget.c
+++ b/src/disks/gdupasswordstrengthwidget.c
@@ -23,7 +23,7 @@ typedef struct _GduPasswordStrengthWidgetClass GduPasswordStrengthWidgetClass;
 
 struct _GduPasswordStrengthWidget
 {
-  GtkHBox parent;
+  GtkBox parent;
 
   GtkWidget *level_bar;
   GtkWidget *notebook;
@@ -33,7 +33,7 @@ struct _GduPasswordStrengthWidget
 
 struct _GduPasswordStrengthWidgetClass
 {
-  GtkHBoxClass parent_class;
+  GtkBoxClass parent_class;
 };
 
 enum
@@ -42,7 +42,7 @@ enum
   PROP_PASSWORD,
 };
 
-G_DEFINE_TYPE (GduPasswordStrengthWidget, gdu_password_strength_widget, GTK_TYPE_HBOX)
+G_DEFINE_TYPE (GduPasswordStrengthWidget, gdu_password_strength_widget, GTK_TYPE_BOX)
 
 static void
 gdu_password_strength_widget_finalize (GObject *object)
diff --git a/src/disks/gduvolumegrid.c b/src/disks/gduvolumegrid.c
index 00204c4..5571a59 100644
--- a/src/disks/gduvolumegrid.c
+++ b/src/disks/gduvolumegrid.c
@@ -851,11 +851,10 @@ render_element (GduVolumeGrid *grid,
             }
           else
             {
-              GdkPixbuf *base_pixbuf;
               GdkPixbuf *pixbuf;
               GError *error = NULL;
-              base_pixbuf = gtk_icon_info_load_symbolic_for_context (info, context, NULL, &error);
-              if (base_pixbuf == NULL)
+              pixbuf = gtk_icon_info_load_symbolic_for_context (info, context, NULL, &error);
+              if (pixbuf == NULL)
                 {
                   g_warning ("Error loading icon %s: %s (%s, %d)",
                              name, error->message, g_quark_to_string (error->domain), error->code);
@@ -865,10 +864,6 @@ render_element (GduVolumeGrid *grid,
                 {
                   guint icon_width;
                   guint icon_height;
-                  GtkIconSource *source;
-                  source = gtk_icon_source_new ();
-                  gtk_icon_source_set_pixbuf (source, base_pixbuf);
-                  pixbuf = gtk_render_icon_pixbuf (context, source, -1);
                   icon_width = gdk_pixbuf_get_width (pixbuf);
                   icon_height = gdk_pixbuf_get_height (pixbuf);
                   gtk_render_icon (context, cr, pixbuf,
@@ -876,10 +871,8 @@ render_element (GduVolumeGrid *grid,
                                    ceil (element->y + element->height - icon_height - 4));
                   icon_offset += icon_width + 2; /* padding */
                   g_object_unref (pixbuf);
-                  g_object_unref (base_pixbuf);
-                  gtk_icon_source_free (source);
                 }
-              gtk_icon_info_free (info);
+              g_object_unref (info);
             }
         }
       gtk_style_context_restore (context);
diff --git a/src/disks/gduwindow.c b/src/disks/gduwindow.c
index c437452..0c947fd 100644
--- a/src/disks/gduwindow.c
+++ b/src/disks/gduwindow.c
@@ -722,7 +722,7 @@ gdu_window_show_attach_disk_image (GduWindow *window)
   dialog = gtk_file_chooser_dialog_new (_("Select Disk Image to Attach"),
                                         GTK_WINDOW (window),
                                         GTK_FILE_CHOOSER_ACTION_OPEN,
-                                        GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+                                        _("_Cancel"), GTK_RESPONSE_CANCEL,
                                         _("_Attach"), GTK_RESPONSE_ACCEPT,
                                         NULL);
   gdu_utils_configure_file_chooser_for_disk_images (GTK_FILE_CHOOSER (dialog),


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