[master 1/1] Use the default levelbar offset values.
by dashea
From: David Shea <dshea(a)redhat.com>
The effect is the same as the previous CSS rule, but now we're working
with instead of around.
---
data/anaconda-gtk.css | 3 +--
pyanaconda/ui/gui/spokes/lib/passphrase.py | 1 +
pyanaconda/ui/gui/spokes/password.py | 1 +
pyanaconda/ui/gui/spokes/user.py | 1 +
4 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/data/anaconda-gtk.css b/data/anaconda-gtk.css
index 045c4ed..07f1b2d 100644
--- a/data/anaconda-gtk.css
+++ b/data/anaconda-gtk.css
@@ -14,8 +14,6 @@
@define-color anaconda_level_bar_medium orange;
@define-color anaconda_level_bar_high green;
-/* The .fill part works around https://bugzilla.gnome.org/show_bug.cgi?id=761416 */
-levelbar.discrete trough block.filled.full,
levelbar.discrete trough block.filled.low {
border-color: darker(@anaconda_level_bar_low);
background: @anaconda_level_bar_low;
@@ -26,6 +24,7 @@ levelbar.discrete trough block.filled.medium {
background: @anaconda_level_bar_medium;
}
+levelbar.discrete trough block.filled.full,
levelbar.discrete trough block.filled.high {
border-color: darker(@anaconda_level_bar_high);
background: @anaconda_level_bar_high;
diff --git a/pyanaconda/ui/gui/spokes/lib/passphrase.py b/pyanaconda/ui/gui/spokes/lib/passphrase.py
index 580a1d3..a6e4134 100644
--- a/pyanaconda/ui/gui/spokes/lib/passphrase.py
+++ b/pyanaconda/ui/gui/spokes/lib/passphrase.py
@@ -62,6 +62,7 @@ def __init__(self, data):
self._strength_bar.add_offset_value("low", 2)
self._strength_bar.add_offset_value("medium", 3)
self._strength_bar.add_offset_value("high", 4)
+ self._strength_bar.add_offset_value("full", 4)
# Configure the password policy, if available. Otherwise use defaults.
self.policy = self.data.anaconda.pwpolicy.get_policy("luks")
diff --git a/pyanaconda/ui/gui/spokes/password.py b/pyanaconda/ui/gui/spokes/password.py
index fab502e..b55d353 100644
--- a/pyanaconda/ui/gui/spokes/password.py
+++ b/pyanaconda/ui/gui/spokes/password.py
@@ -106,6 +106,7 @@ def initialize(self):
self.pw_bar.add_offset_value("low", 2)
self.pw_bar.add_offset_value("medium", 3)
self.pw_bar.add_offset_value("high", 4)
+ self.pw_bar.add_offset_value("full", 4)
# Configure the password policy, if available. Otherwise use defaults.
self.policy = self.data.anaconda.pwpolicy.get_policy("root")
diff --git a/pyanaconda/ui/gui/spokes/user.py b/pyanaconda/ui/gui/spokes/user.py
index 9681f14..e4e49c7 100644
--- a/pyanaconda/ui/gui/spokes/user.py
+++ b/pyanaconda/ui/gui/spokes/user.py
@@ -277,6 +277,7 @@ def initialize(self):
self.pw_bar.add_offset_value("low", 2)
self.pw_bar.add_offset_value("medium", 3)
self.pw_bar.add_offset_value("high", 4)
+ self.pw_bar.add_offset_value("full", 4)
# Configure the password policy, if available. Otherwise use defaults.
self.policy = self.data.anaconda.pwpolicy.get_policy("user")
--
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/6d56107348e73c7e31b187ca01...
8 years, 2 months
[master 3/3] Do not change the GUI language to a missing locale.
(#1312607)
by dashea
From: David Shea <dshea(a)redhat.com>
If the user attempts to change the language to a locale that is not
available, fallback to the default language instead. This will prevent a
translation from being used where the localization data for the
translation, such as the text direction, is missing.
---
pyanaconda/localization.py | 15 +++++++++++----
pyanaconda/ui/gui/spokes/welcome.py | 8 ++++----
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/pyanaconda/localization.py b/pyanaconda/localization.py
index 8a84f7d..c447867 100644
--- a/pyanaconda/localization.py
+++ b/pyanaconda/localization.py
@@ -215,11 +215,15 @@ def setup_locale(locale, lang=None, text_mode=False):
If the font for the locale can't be displayed in the Linux console,
we fall back to the English locale.
+ This function returns the locale that was used in the setlocale call, which,
+ depending on what the environment and interface is able to support, may be
+ different from the locale requested.
+
:param str locale: locale to setup
:param lang: ksdata.lang object or None
:param bool text_mode: if the locale is being setup for text mode
- :return: None
- :rtype: None
+ :return: the locale that was actually set
+ :rtype: str
"""
@@ -275,8 +279,9 @@ def setup_locale(locale, lang=None, text_mode=False):
locale_mod.setlocale(locale_mod.LC_ALL, locale)
except locale_mod.Error as e:
log.debug("setlocale failed: %s", e)
- setenv("LANG", constants.DEFAULT_LANG)
- locale_mod.setlocale(locale_mod.LC_ALL, constants.DEFAULT_LANG)
+ locale = constants.DEFAULT_LANG
+ setenv("LANG", locale)
+ locale_mod.setlocale(locale_mod.LC_ALL, locale)
# This part is pretty gross:
# In python3, sys.stdout and friends are TextIOWrapper objects that translate
@@ -297,6 +302,8 @@ def setup_locale(locale, lang=None, text_mode=False):
sys.stdout = io.TextIOWrapper(sys.stdout.detach())
sys.stderr = io.TextIOWrapper(sys.stderr.detach())
+ return locale
+
def get_english_name(locale):
"""
Function returning english name for the given locale.
diff --git a/pyanaconda/ui/gui/spokes/welcome.py b/pyanaconda/ui/gui/spokes/welcome.py
index 7a909ba..a53eafd 100644
--- a/pyanaconda/ui/gui/spokes/welcome.py
+++ b/pyanaconda/ui/gui/spokes/welcome.py
@@ -70,8 +70,8 @@ def apply(self):
(store, itr) = self._localeSelection.get_selected()
locale = store[itr][1]
+ locale = localization.setup_locale(locale, self.data.lang, text_mode=False)
self._set_lang(locale)
- localization.setup_locale(locale, self.data.lang, text_mode=False)
# Skip timezone and keyboard default setting for kickstart installs.
# The user may have provided these values via kickstart and if not, we
@@ -225,8 +225,8 @@ def initialize(self):
store.set(newItr, 0, "", 1, "", 2, "", 3, True)
# setup the "best" locale
- self._set_lang(locales[0])
- localization.setup_locale(locales[0], self.data.lang)
+ locale = localization.setup_locale(locales[0], self.data.lang)
+ self._set_lang(locale)
self._select_locale(self.data.lang.lang)
def _retranslate_one(self, widgetName, context=None):
@@ -315,8 +315,8 @@ def on_locale_selection_changed(self, selection):
if selected:
lang = store[selected[0]][1]
+ lang = localization.setup_locale(lang)
self._set_lang(lang)
- localization.setup_locale(lang)
self.retranslate()
# Reset the text direction
--
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/18d0c7fe197bca12481847d5bf...
8 years, 2 months
[master 2/3] Don't crash when setting an unavailable locale
(#1312607)
by dashea
From: David Shea <dshea(a)redhat.com>
Nothing is guaranteed to be available anymore, so just do the best we
can.
---
pyanaconda/localization.py | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/localization.py b/pyanaconda/localization.py
index e043b17..8a84f7d 100644
--- a/pyanaconda/localization.py
+++ b/pyanaconda/localization.py
@@ -266,9 +266,17 @@ def setup_locale(locale, lang=None, text_mode=False):
os.environ["LANG"] = locale # pylint: disable=environment-modify
# set the locale to the value we have selected
+ # Since glibc does not install all locales, an installable locale may not
+ # actually be available right now. Give it a shot and fallback.
log.debug("setting locale to: %s", locale)
setenv("LANG", locale)
- locale_mod.setlocale(locale_mod.LC_ALL, locale)
+
+ try:
+ locale_mod.setlocale(locale_mod.LC_ALL, locale)
+ except locale_mod.Error as e:
+ log.debug("setlocale failed: %s", e)
+ setenv("LANG", constants.DEFAULT_LANG)
+ locale_mod.setlocale(locale_mod.LC_ALL, constants.DEFAULT_LANG)
# This part is pretty gross:
# In python3, sys.stdout and friends are TextIOWrapper objects that translate
--
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/7a7968626521044d2a3ae938cc...
8 years, 2 months
[master 1/3] Change the default locale to C.UTF-8 (#1312607)
by dashea
From: David Shea <dshea(a)redhat.com>
C.UTF-8 is a newish glibc locale this is supposed to solve the problem
of how to get an untranslated locale that supports multi-byte
characters. I mean, it's still English, but not so overtly. And it's
also the only locale besides regular old 7-bit C that's guaranteed to be
installed anymore.
---
data/systemd/anaconda-tmux@.service | 2 +-
data/systemd/anaconda.service | 2 +-
pyanaconda/constants.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/data/systemd/anaconda-tmux@.service b/data/systemd/anaconda-tmux@.service
index e2fd1b8..c2ecdd7 100644
--- a/data/systemd/anaconda-tmux@.service
+++ b/data/systemd/anaconda-tmux@.service
@@ -8,7 +8,7 @@ ConditionPathIsDirectory=!/sys/hypervisor/s390
[Service]
Type=idle
WorkingDirectory=/root
-Environment=LANG=en_US.UTF-8
+Environment=LANG=C.UTF-8
ExecStartPre=/usr/bin/echo -e \033%G
ExecStart=/usr/bin/tmux -u attach -t anaconda
StandardInput=tty
diff --git a/data/systemd/anaconda.service b/data/systemd/anaconda.service
index a80c6bb..e0e92e2 100644
--- a/data/systemd/anaconda.service
+++ b/data/systemd/anaconda.service
@@ -5,6 +5,6 @@ Wants=anaconda-noshell.service
[Service]
Type=forking
-Environment=HOME=/root MALLOC_CHECK_=2 MALLOC_PERTURB_=204 PATH=/usr/bin:/bin:/sbin:/usr/sbin:/mnt/sysimage/bin:/mnt/sysimage/usr/bin:/mnt/sysimage/usr/sbin:/mnt/sysimage/sbin LANG=en_US.UTF-8 GDK_BACKEND=x11 XDG_RUNTIME_DIR=/tmp GIO_USE_VFS=local
+Environment=HOME=/root MALLOC_CHECK_=2 MALLOC_PERTURB_=204 PATH=/usr/bin:/bin:/sbin:/usr/sbin:/mnt/sysimage/bin:/mnt/sysimage/usr/bin:/mnt/sysimage/usr/sbin:/mnt/sysimage/sbin LANG=C.UTF-8 GDK_BACKEND=x11 XDG_RUNTIME_DIR=/tmp GIO_USE_VFS=local
WorkingDirectory=/root
ExecStart=/usr/bin/tmux -u -f /usr/share/anaconda/tmux.conf start
diff --git a/pyanaconda/constants.py b/pyanaconda/constants.py
index fe5cbc0..73e95fd 100644
--- a/pyanaconda/constants.py
+++ b/pyanaconda/constants.py
@@ -61,7 +61,7 @@
BASE_REPO_NAME = "anaconda"
# NOTE: this should be LANG_TERRITORY.CODESET, e.g. en_US.UTF-8
-DEFAULT_LANG = "en_US.UTF-8"
+DEFAULT_LANG = "C.UTF-8"
DEFAULT_VC_FONT = "eurlatgr"
--
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/8f914fbe55ea42554189c63041...
8 years, 2 months
[master 2/2] Don't crash when setting an unavailable locale
(#1312607)
by dashea
From: David Shea <dshea(a)redhat.com>
Nothing is guaranteed to be available anymore, so just do the best we
can.
---
pyanaconda/localization.py | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/localization.py b/pyanaconda/localization.py
index e043b17..8a84f7d 100644
--- a/pyanaconda/localization.py
+++ b/pyanaconda/localization.py
@@ -266,9 +266,17 @@ def setup_locale(locale, lang=None, text_mode=False):
os.environ["LANG"] = locale # pylint: disable=environment-modify
# set the locale to the value we have selected
+ # Since glibc does not install all locales, an installable locale may not
+ # actually be available right now. Give it a shot and fallback.
log.debug("setting locale to: %s", locale)
setenv("LANG", locale)
- locale_mod.setlocale(locale_mod.LC_ALL, locale)
+
+ try:
+ locale_mod.setlocale(locale_mod.LC_ALL, locale)
+ except locale_mod.Error as e:
+ log.debug("setlocale failed: %s", e)
+ setenv("LANG", constants.DEFAULT_LANG)
+ locale_mod.setlocale(locale_mod.LC_ALL, constants.DEFAULT_LANG)
# This part is pretty gross:
# In python3, sys.stdout and friends are TextIOWrapper objects that translate
--
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/7a7968626521044d2a3ae938cc...
8 years, 2 months
[master 1/2] Change the default locale to C.UTF-8 (#1312607)
by dashea
From: David Shea <dshea(a)redhat.com>
C.UTF-8 is a newish glibc locale this is supposed to solve the problem
of how to get an untranslated locale that supports multi-byte
characters. I mean, it's still English, but not so overtly. And it's
also the only locale besides regular old 7-bit C that's guaranteed to be
installed anymore.
---
data/systemd/anaconda-tmux@.service | 2 +-
data/systemd/anaconda.service | 2 +-
pyanaconda/constants.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/data/systemd/anaconda-tmux@.service b/data/systemd/anaconda-tmux@.service
index e2fd1b8..c2ecdd7 100644
--- a/data/systemd/anaconda-tmux@.service
+++ b/data/systemd/anaconda-tmux@.service
@@ -8,7 +8,7 @@ ConditionPathIsDirectory=!/sys/hypervisor/s390
[Service]
Type=idle
WorkingDirectory=/root
-Environment=LANG=en_US.UTF-8
+Environment=LANG=C.UTF-8
ExecStartPre=/usr/bin/echo -e \033%G
ExecStart=/usr/bin/tmux -u attach -t anaconda
StandardInput=tty
diff --git a/data/systemd/anaconda.service b/data/systemd/anaconda.service
index a80c6bb..e0e92e2 100644
--- a/data/systemd/anaconda.service
+++ b/data/systemd/anaconda.service
@@ -5,6 +5,6 @@ Wants=anaconda-noshell.service
[Service]
Type=forking
-Environment=HOME=/root MALLOC_CHECK_=2 MALLOC_PERTURB_=204 PATH=/usr/bin:/bin:/sbin:/usr/sbin:/mnt/sysimage/bin:/mnt/sysimage/usr/bin:/mnt/sysimage/usr/sbin:/mnt/sysimage/sbin LANG=en_US.UTF-8 GDK_BACKEND=x11 XDG_RUNTIME_DIR=/tmp GIO_USE_VFS=local
+Environment=HOME=/root MALLOC_CHECK_=2 MALLOC_PERTURB_=204 PATH=/usr/bin:/bin:/sbin:/usr/sbin:/mnt/sysimage/bin:/mnt/sysimage/usr/bin:/mnt/sysimage/usr/sbin:/mnt/sysimage/sbin LANG=C.UTF-8 GDK_BACKEND=x11 XDG_RUNTIME_DIR=/tmp GIO_USE_VFS=local
WorkingDirectory=/root
ExecStart=/usr/bin/tmux -u -f /usr/share/anaconda/tmux.conf start
diff --git a/pyanaconda/constants.py b/pyanaconda/constants.py
index fe5cbc0..73e95fd 100644
--- a/pyanaconda/constants.py
+++ b/pyanaconda/constants.py
@@ -61,7 +61,7 @@
BASE_REPO_NAME = "anaconda"
# NOTE: this should be LANG_TERRITORY.CODESET, e.g. en_US.UTF-8
-DEFAULT_LANG = "en_US.UTF-8"
+DEFAULT_LANG = "C.UTF-8"
DEFAULT_VC_FONT = "eurlatgr"
--
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/8f914fbe55ea42554189c63041...
8 years, 2 months