[nautilus] mime-actions: make unhandled type dialogs modal



commit 0b61abdadbc1f6c55f97c7a00d315ea32f8e03b4
Author: Ernestas Kulik <ernestas kulik gmail com>
Date:   Mon Apr 4 10:42:28 2016 +0300

    mime-actions: make unhandled type dialogs modal
    
    The unhandled type message dialog and application chooser dialog for
    files of unhandled type are not modal, thus allowing the user to
    inadvertently spawn multiple dialogs.
    
    This commit fixes that by making the dialogs modal.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=627259

 src/nautilus-mime-actions.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/nautilus-mime-actions.c b/src/nautilus-mime-actions.c
index b132544..7a1a470 100644
--- a/src/nautilus-mime-actions.c
+++ b/src/nautilus-mime-actions.c
@@ -1090,7 +1090,8 @@ choose_program (GtkDialog *message_dialog, int response, gpointer callback_data)
        gtk_widget_destroy (GTK_WIDGET (message_dialog));
 
        dialog = gtk_app_chooser_dialog_new (parameters->parent_window,
-                                            0, location);
+                                            GTK_DIALOG_MODAL,
+                                            location);
        g_object_set_data_full (G_OBJECT (dialog), 
                                "mime-action:file",
                                nautilus_file_ref (file),
@@ -1116,7 +1117,7 @@ show_unhandled_type_error (ActivateParametersInstall *parameters)
        char *error_message = get_application_no_mime_type_handler_message (parameters->file, 
parameters->uri);
        if (g_content_type_is_unknown (mime_type)) {
                dialog = gtk_message_dialog_new (parameters->parent_window,
-                                                GTK_DIALOG_DESTROY_WITH_PARENT,
+                                                GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL,
                                                 GTK_MESSAGE_ERROR,
                                                 0,
                                                 NULL);
@@ -1129,7 +1130,7 @@ show_unhandled_type_error (ActivateParametersInstall *parameters)
                text = g_strdup_printf (_("There is no application installed for “%s” files"), 
g_content_type_get_description (mime_type));
 
                dialog = gtk_message_dialog_new (parameters->parent_window,
-                                                GTK_DIALOG_DESTROY_WITH_PARENT,
+                                                GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL,
                                                 GTK_MESSAGE_ERROR,
                                                 0,
                                                 NULL);


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