[gnome-initial-setup/youre-welcome: 4/4] Allow overriding welcome message in vendor.conf
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-initial-setup/youre-welcome: 4/4] Allow overriding welcome message in vendor.conf
- Date: Thu, 6 Aug 2020 01:59:11 +0000 (UTC)
commit 3ca4fae5c1aa5cf9252231b91aa0fb0325731e8a
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Aug 5 21:46:40 2020 -0400
Allow overriding welcome message in vendor.conf
Look for
[welcome]
entity=THING
in the vendor.conf file, and make the welcome message
"Welcome to THING!"
If we don't find that entry in vendor.conf, default to
"Welcome to GNOME $VERSION!"
where version is read from the gnome-version.xml file.
gnome-initial-setup/pages/welcome/gis-welcome-page.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/gnome-initial-setup/pages/welcome/gis-welcome-page.c
b/gnome-initial-setup/pages/welcome/gis-welcome-page.c
index 519b9397..41a11ef0 100644
--- a/gnome-initial-setup/pages/welcome/gis-welcome-page.c
+++ b/gnome-initial-setup/pages/welcome/gis-welcome-page.c
@@ -28,6 +28,9 @@
#include "gis-welcome-page.h"
#include "gis-assistant.h"
+#define VENDOR_WELCOME_GROUP "welcome"
+#define VENDOR_ENTITY_KEY "entity"
+
struct _GisWelcomePagePrivate
{
GtkWidget *header;
@@ -178,11 +181,19 @@ static void
update_welcome_title (GisWelcomePage *page)
{
GisWelcomePagePrivate *priv = gis_welcome_page_get_instance_private (page);
- g_autofree char *version = NULL;
+ g_autofree char *entity = gis_driver_conf_get_string (GIS_PAGE (page)->driver, VENDOR_WELCOME_GROUP,
VENDOR_ENTITY_KEY);
g_autofree char *text = NULL;
- load_gnome_version (&version, NULL, NULL);
- text = g_strdup_printf (_("Welcome to GNOME %s !"), version);
+ if (entity == NULL) {
+ g_autofree char *version = NULL;
+ load_gnome_version (&version, NULL, NULL);
+ entity = g_strdup_printf ("GNOME %s", version);
+ }
+
+ /* Translators: The string is a distro name,
+ * e.g.: Welcome to GNOME 3.36 !
+ */
+ text = g_strdup_printf (_("Welcome to %s !"), entity);
gtk_label_set_label (GTK_LABEL (priv->title), text);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]