diff options
author | Florian Müllner <fmuellner@gnome.org> | 2020-05-01 17:01:34 +0200 |
---|---|---|
committer | Florian Müllner <fmuellner@gnome.org> | 2020-05-01 18:22:39 +0200 |
commit | f28c6d34a7b0553b7a012ae75c4d528999026162 (patch) | |
tree | 0583733caf74c2972c40c39bf902eef3a6326aa0 | |
parent | c3b912722e95794eba0ae4fdc6958eeca4a4480a (diff) | |
download | gtk+-f28c6d34a7b0553b7a012ae75c4d528999026162.tar.gz |
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.
-rw-r--r-- | gtk/gtkappchooserdialog.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gtk/gtkappchooserdialog.c b/gtk/gtkappchooserdialog.c index 0c922cd48f..b36fb88599 100644 --- a/gtk/gtkappchooserdialog.c +++ b/gtk/gtkappchooserdialog.c @@ -199,16 +199,18 @@ set_dialog_properties (GtkAppChooserDialog *self) unknown = g_content_type_is_unknown (self->priv->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->priv->content_type) { - title = g_strdup (_("Select Application")); /* Translators: %s is a file type description */ subtitle = g_strdup_printf (_("Opening “%s” files."), unknown ? self->priv->content_type : description); |