[nautilus] mime-actions: don't use g_object_set to set dialog text



commit 2ab8c235fbe47ab363335615f341d7b6a953517e
Author: Ernestas Kulik <ernestas kulik gmail com>
Date:   Mon Apr 4 11:04:37 2016 +0300

    mime-actions: don't use g_object_set to set dialog text
    
    Currently, the text for unhandled type message dialogs is set by
    setting the associated GObject properties. That is unnecessary and
    results in hardcoded property names.
    
    The fix is to use GtkMessageDialog functions.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=627259

 src/nautilus-mime-actions.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/src/nautilus-mime-actions.c b/src/nautilus-mime-actions.c
index 7a1a470..a7fd4c9 100644
--- a/src/nautilus-mime-actions.c
+++ b/src/nautilus-mime-actions.c
@@ -1120,11 +1120,9 @@ show_unhandled_type_error (ActivateParametersInstall *parameters)
                                                 GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL,
                                                 GTK_MESSAGE_ERROR,
                                                 0,
-                                                NULL);
-               g_object_set (dialog,
-                             "text", error_message,
-                             "secondary-text", _("The file is of an unknown type"),
-                             NULL);
+                                                "%s", error_message);
+               gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+                                                         _("The file is of an unknown type"));
        } else {
                char *text;
                text = g_strdup_printf (_("There is no application installed for “%s” files"), 
g_content_type_get_description (mime_type));
@@ -1133,11 +1131,9 @@ show_unhandled_type_error (ActivateParametersInstall *parameters)
                                                 GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL,
                                                 GTK_MESSAGE_ERROR,
                                                 0,
-                                                NULL);
-               g_object_set (dialog,
-                             "text", error_message,
-                             "secondary-text", text,
-                             NULL);
+                                                "%s", error_message);
+               gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+                                                         text);
 
                g_free (text);
        }


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