[gnome-tour/bilelmoussaoui/design-review] Allow distro to rebrand the app



commit d508815ffff84ea688b5412bf8b41a51b86da75f
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Wed Jan 29 15:40:20 2020 +0100

    Allow distro to rebrand the app

 README.md                              | 16 +++++++++++++++-
 data/org.gnome.Tour.metainfo.xml.in.in |  2 +-
 meson_options.txt                      | 21 +++++++++++++++++++++
 src/config.rs.in                       |  3 +++
 src/meson.build                        |  3 +++
 src/widgets/pages/welcome.rs           |  5 +++--
 6 files changed, 46 insertions(+), 4 deletions(-)
---
diff --git a/README.md b/README.md
index fef2ba8..57c593c 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,15 @@
-# GNOME Greeter & Tour
\ No newline at end of file
+# GNOME Greeter & Tour
+
+
+
+
+
+
+
+
+#### Note for distributions:
+
+You can customize the distribution name, version and the displayed icon using the config options
+```
+-Ddistro_name=Fedora -Ddistro_version=3.32 -Ddistro_icon_name=fedora-logo
+```
diff --git a/data/org.gnome.Tour.metainfo.xml.in.in b/data/org.gnome.Tour.metainfo.xml.in.in
index 08ab0d2..c9df60e 100644
--- a/data/org.gnome.Tour.metainfo.xml.in.in
+++ b/data/org.gnome.Tour.metainfo.xml.in.in
@@ -7,7 +7,7 @@
   <name>GNOME Tour</name>
   <summary>GNOME Tour and Greeter.</summary>
   <description>
-    <p>A guided tour & greeter for GNOME.</p>
+    <p>A guided tour and greeter for GNOME.</p>
   </description>
   <screenshots>
       <screenshot type="default">
diff --git a/meson_options.txt b/meson_options.txt
index e66cb5d..036cd86 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -8,3 +8,24 @@ option (
   value: 'default',
   description: 'The build profile for GNOME Tour. One of "default" or "development".'
 )
+
+option (
+  'distro_name',
+  type: 'string',
+  value: 'GNOME',
+  description: 'Distro name, used for branding.'
+)
+
+option (
+  'distro_icon_name',
+  type: 'string',
+  value: 'start-here-symbolic',
+  description: 'Distro icon name, used for branding.'
+)
+
+option (
+  'distro_version',
+  type: 'string',
+  value: '3.36',
+  description: 'Distro version, used for branding.'
+)
diff --git a/src/config.rs.in b/src/config.rs.in
index ee5cba3..0437846 100644
--- a/src/config.rs.in
+++ b/src/config.rs.in
@@ -5,3 +5,6 @@ pub static NAME_SUFFIX: &'static str = @NAME_SUFFIX@;
 pub static VERSION: &'static str = @VERSION@;
 pub static GETTEXT_PACKAGE: &'static str = @GETTEXT_PACKAGE@;
 pub static LOCALEDIR: &'static str = @LOCALEDIR@;
+pub static DISTRO_NAME: &'static str = @DISTRO_NAME@;
+pub static DISTRO_VERSION: &'static str = @DISTRO_VERSION@;
+pub static DISTRO_ICON_NAME: &'static str = @DISTRO_ICON_NAME@;
diff --git a/src/meson.build b/src/meson.build
index 3763e74..9cb2c86 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -6,6 +6,9 @@ global_conf.set_quoted('NAME_SUFFIX', name_suffix)
 global_conf.set_quoted('VERSION', version + version_suffix)
 global_conf.set_quoted('GETTEXT_PACKAGE', gettext_package)
 global_conf.set_quoted('LOCALEDIR', localedir)
+global_conf.set_quoted('DISTRO_NAME', get_option('distro_name'))
+global_conf.set_quoted('DISTRO_VERSION', get_option('distro_version'))
+global_conf.set_quoted('DISTRO_ICON_NAME', get_option('distro_icon_name'))
 config = configure_file(
   input: 'config.rs.in',
   output: 'config.rs',
diff --git a/src/widgets/pages/welcome.rs b/src/widgets/pages/welcome.rs
index 956469f..91dd3a7 100644
--- a/src/widgets/pages/welcome.rs
+++ b/src/widgets/pages/welcome.rs
@@ -1,3 +1,4 @@
+use crate::config;
 use gettextrs::gettext;
 use gtk::prelude::*;
 
@@ -21,11 +22,11 @@ impl WelcomePageWidget {
         self.widget.set_margin_top(24);
         self.widget.set_margin_bottom(24);
 
-        let logo = gtk::Image::new_from_icon_name(Some("start-here-symbolic"));
+        let logo = gtk::Image::new_from_icon_name(Some(config::DISTRO_ICON_NAME));
         logo.set_pixel_size(196);
         self.widget.add(&logo);
 
-        let title = gtk::Label::new(Some(&gettext("Welcome to GNOME 3.34")));
+        let title = gtk::Label::new(Some(&gettext(format!("Welcome to {} {}", config::DISTRO_NAME, 
config::DISTRO_VERSION))));
         title.set_margin_top(36);
         title.get_style_context().add_class("large-title");
         self.widget.add(&title);


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