aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-installer/anaconda/files/0061-Tweak-label-name.patch
blob: cd0e1edd6782e2d1772469b22a99985f4d5d209a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
From 15dd69296c5607aa718feb071d0508c0a5d0ed9f Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Mon, 1 Jul 2019 10:38:49 +0800
Subject: [PATCH] Tweak label name

In yocto, the product name is too long, which enlarge
the gui window, short them.

Upstream-Status: Inappropriate [oe specific]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 pyanaconda/product.py               | 4 ++++
 pyanaconda/ui/gui/spokes/welcome.py | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/product.py b/pyanaconda/product.py
index 9d97dab..5548f99 100644
--- a/pyanaconda/product.py
+++ b/pyanaconda/product.py
@@ -52,6 +52,10 @@ if productVersion == "development":
     productVersion = "rawhide"
 
 def distributionText():
+    if '(' in productName and ')' in productName:
+        return _("%(productName)s %(productVersion)s INSTALLATION") % \
+                 {"productName": productName.split()[0], "productVersion": productVersion}
+
     return _("%(productName)s %(productVersion)s INSTALLATION") % \
              {"productName": productName, "productVersion": productVersion}
 
diff --git a/pyanaconda/ui/gui/spokes/welcome.py b/pyanaconda/ui/gui/spokes/welcome.py
index c1ac605..dc8d9e6 100644
--- a/pyanaconda/ui/gui/spokes/welcome.py
+++ b/pyanaconda/ui/gui/spokes/welcome.py
@@ -39,7 +39,7 @@ from pyanaconda import flags
 from pyanaconda import geoloc
 from pyanaconda.core.i18n import _, C_
 from pyanaconda.core.util import ipmi_abort
-from pyanaconda.core.constants import DEFAULT_LANG, WINDOW_TITLE_TEXT
+from pyanaconda.core.constants import DEFAULT_LANG, WINDOW_TITLE_TEXT, shortProductName
 from pyanaconda.modules.common.constants.services import TIMEZONE, LOCALIZATION
 
 from pyanaconda.anaconda_loggers import get_module_logger
@@ -238,7 +238,7 @@ class WelcomeLanguageSpoke(LangLocaleHandler, StandaloneSpoke):
         welcomeLabel = self.builder.get_object("welcomeLabel")
 
         welcomeLabel.set_text(_("WELCOME TO %(name)s %(version)s.") %
-                {"name" : productName.upper(), "version" : productVersion})         # pylint: disable=no-member
+                {"name" : shortProductName.upper(), "version" : productVersion})         # pylint: disable=no-member
 
         # Retranslate the language (filtering) entry's placeholder text
         languageEntry = self.builder.get_object("languageEntry")
-- 
2.7.4