summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCorey Berla <corey@berla.me>2022-08-05 13:16:49 -0700
committerAntónio Fernandes <antoniof@gnome.org>2022-08-07 01:15:29 +0000
commiteee342797748d3f1c757c5b972cb7fc470c0a928 (patch)
tree90a7fffa969d765c20192078978a5c7e1ddd1268 /src
parent1ccb3fe528731a1309d196036239f84d32ea837f (diff)
downloadnautilus-eee342797748d3f1c757c5b972cb7fc470c0a928.tar.gz
app-chooser: Add a description above the list
Diffstat (limited to 'src')
-rw-r--r--src/nautilus-app-chooser.c10
-rw-r--r--src/resources/ui/nautilus-app-chooser.ui9
2 files changed, 19 insertions, 0 deletions
diff --git a/src/nautilus-app-chooser.c b/src/nautilus-app-chooser.c
index 21e6c5161..33c2c1646 100644
--- a/src/nautilus-app-chooser.c
+++ b/src/nautilus-app-chooser.c
@@ -21,6 +21,7 @@ struct _NautilusAppChooser
gboolean single_content_type;
GtkWidget *app_chooser_widget_box;
+ GtkWidget *label_description;
GtkWidget *label_content_type_description;
GtkWidget *set_as_default_switch;
GtkWidget *set_default_box;
@@ -152,6 +153,7 @@ nautilus_app_chooser_constructed (GObject *object)
NautilusAppChooser *self = NAUTILUS_APP_CHOOSER (object);
g_autoptr (GAppInfo) info = NULL;
g_autofree gchar *content_type_description = NULL;
+ g_autofree gchar *description = NULL;
gchar *title;
G_OBJECT_CLASS (nautilus_app_chooser_parent_class)->constructed (object);
@@ -178,6 +180,13 @@ nautilus_app_chooser_constructed (GObject *object)
G_CALLBACK (on_application_selected),
self);
+ if (self->file_name != NULL)
+ {
+ /* Translators: %s is the filename. i.e. "Choose an application to open test.jpg" */
+ description = g_strdup_printf (_("Choose an application to open <b>%s</b>."), self->file_name);
+ gtk_label_set_markup (GTK_LABEL (self->label_description), description);
+ }
+
if (!self->single_content_type)
{
title = _("Open Items");
@@ -230,6 +239,7 @@ nautilus_app_chooser_class_init (NautilusAppChooserClass *klass)
gtk_widget_class_bind_template_child (widget_class, NautilusAppChooser, app_chooser_widget_box);
gtk_widget_class_bind_template_child (widget_class, NautilusAppChooser, set_as_default_switch);
+ gtk_widget_class_bind_template_child (widget_class, NautilusAppChooser, label_description);
gtk_widget_class_bind_template_child (widget_class, NautilusAppChooser, label_content_type_description);
gtk_widget_class_bind_template_child (widget_class, NautilusAppChooser, set_default_box);
diff --git a/src/resources/ui/nautilus-app-chooser.ui b/src/resources/ui/nautilus-app-chooser.ui
index c66dbe83e..d32ede0e5 100644
--- a/src/resources/ui/nautilus-app-chooser.ui
+++ b/src/resources/ui/nautilus-app-chooser.ui
@@ -12,6 +12,15 @@
<object class="GtkBox" id="content_area">
<property name="orientation">vertical</property>
<child>
+ <object class="GtkLabel" id="label_description">
+ <property name="margin-top">18</property>
+ <property name="wrap">True</property>
+ <property name="wrap-mode">PANGO_WRAP_WORD_CHAR</property>
+ <property name="halign">center</property>
+ <property name="label" translatable="yes">Choose an application to open the selected files.</property>
+ </object>
+ </child>
+ <child>
<object class="GtkStack">
<property name="hexpand">True</property>
<child>