aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-installer/anaconda/files/0061-Tweak-label-name.patch
blob: 055cc31acfec24852b02f18dd765c8a04d1c9b4a (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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>

Rebase for anaconda 34.

Signed-off-by: Kai Kang <kai.kang@windriver.com>

Rebase for anaconda 37 on 20221020.

Signed-off-by: Kai Kang <kai.kang@windriver.com>

Rebase for anaconda 38 on 20231107.

Signed-off-by: Kai Kang <kai.kang@windriver.com>

Rebase for anaconda 39 on 20240304.

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 pyanaconda/product.py               | 4 ++++
 pyanaconda/ui/gui/spokes/welcome.py | 5 +++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/product.py b/pyanaconda/product.py
index 2b680cc9c6..748feaf98f 100644
--- a/pyanaconda/product.py
+++ b/pyanaconda/product.py
@@ -72,6 +72,10 @@ productVersion = trim_product_version_for_ui(productVersion)
 
 
 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.upper(),
         "productVersion": productVersion.upper()
diff --git a/pyanaconda/ui/gui/spokes/welcome.py b/pyanaconda/ui/gui/spokes/welcome.py
index a33934c634..42e6237ec7 100644
--- a/pyanaconda/ui/gui/spokes/welcome.py
+++ b/pyanaconda/ui/gui/spokes/welcome.py
@@ -37,7 +37,8 @@ from pyanaconda.product import distributionText, isFinal, productName, productVe
 from pyanaconda import flags
 from pyanaconda.core.i18n import _
 from pyanaconda.core.util import ipmi_abort
-from pyanaconda.core.constants import DEFAULT_LANG, WINDOW_TITLE_TEXT, TIMEZONE_PRIORITY_LANGUAGE
+from pyanaconda.core.constants import DEFAULT_LANG, WINDOW_TITLE_TEXT, \
+    TIMEZONE_PRIORITY_LANGUAGE, shortProductName
 from pyanaconda.modules.common.constants.services import TIMEZONE, LOCALIZATION
 from pyanaconda.modules.common.util import is_module_available
 from pyanaconda.anaconda_loggers import get_module_logger
@@ -204,7 +205,7 @@ class WelcomeLanguageSpoke(StandaloneSpoke, LangLocaleHandler):
         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