[nautilus/wip/coreyberla/app-chooser-fixes: 1/8] app-chooser: Remove "reset" ability




commit 445cfcc4284e99fa40380804a1d06ba587c65923
Author: Corey Berla <corey berla me>
Date:   Mon Aug 8 11:07:01 2022 -0700

    app-chooser: Remove "reset" ability
    
    We are only changing the default after clicking "open" based on the
    design.  Resetting the default used to make sense when it has a
    dedicated button, but it no longer makes sense.  Remove the "reset"
    ability by setting the GtkSwitch as insenstive for the current
    default and only taking action if the switch is active.

 src/nautilus-app-chooser.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
---
diff --git a/src/nautilus-app-chooser.c b/src/nautilus-app-chooser.c
index 33c2c1646..bebc8def0 100644
--- a/src/nautilus-app-chooser.c
+++ b/src/nautilus-app-chooser.c
@@ -62,11 +62,6 @@ open_button_clicked_cb (GtkButton          *button,
         g_app_info_set_as_default_for_type (info, self->content_type,
                                             &error);
     }
-    else
-    {
-        g_app_info_reset_type_associations (self->content_type);
-        gtk_app_chooser_refresh (GTK_APP_CHOOSER (self->app_chooser_widget));
-    }
 
     if (error != NULL)
     {
@@ -101,6 +96,7 @@ on_application_selected (GtkAppChooserWidget *widget,
     is_default = default_app != NULL && g_app_info_equal (info, default_app);
 
     gtk_switch_set_state (GTK_SWITCH (self->set_as_default_switch), is_default);
+    gtk_widget_set_sensitive (GTK_WIDGET (self->set_as_default_switch), !is_default);
 }
 
 static void


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