[gtk: 1/2] appchooserdialog: Don't show broken subtitles



commit 3f1bd3722dd3374bef07346138a0ed9e95d3b9fe
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri May 1 17:01:34 2020 +0200

    appchooserdialog: Don't show broken subtitles
    
    Commit 07beb6dba29 made GtkAppChooserWidget useful with no content-type,
    however when used in a GtkAppChooserDialog, this will lead to a confusing
    "Opening (null) files" subtitle.
    
    Fix this by omitting the subtitle altogether in that case.

 gtk/gtkappchooserdialog.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkappchooserdialog.c b/gtk/gtkappchooserdialog.c
index 8dcd8a7de9..f9fa243280 100644
--- a/gtk/gtkappchooserdialog.c
+++ b/gtk/gtkappchooserdialog.c
@@ -200,16 +200,18 @@ set_dialog_properties (GtkAppChooserDialog *self)
       unknown = g_content_type_is_unknown (self->content_type);
     }
 
+  title = g_strdup (_("Select Application"));
+  subtitle = NULL;
+  string = NULL;
+
   if (name != NULL)
     {
-      title = g_strdup (_("Select Application"));
       /* Translators: %s is a filename */
       subtitle = g_strdup_printf (_("Opening “%s”."), name);
       string = g_strdup_printf (_("No applications found for “%s”"), name);
     }
-  else
+  else if (self->content_type)
     {
-      title = g_strdup (_("Select Application"));
       /* Translators: %s is a file type description */
       subtitle = g_strdup_printf (_("Opening “%s” files."), 
                                   unknown ? self->content_type : description);


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