[PATCH] Do not have password fields with contents grab focus (#959463).
by Chris Lumens
---
pyanaconda/ui/gui/spokes/password.py | 5 -----
pyanaconda/ui/gui/spokes/user.py | 1 -
2 files changed, 6 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/password.py b/pyanaconda/ui/gui/spokes/password.py
index ff029ea..1653dc2 100644
--- a/pyanaconda/ui/gui/spokes/password.py
+++ b/pyanaconda/ui/gui/spokes/password.py
@@ -62,10 +62,6 @@ class PasswordSpoke(FirstbootSpokeMixIn, NormalSpoke):
self.pw.set_placeholder_text(_("The password was set by kickstart."))
self.confirm.set_placeholder_text(_("The password was set by kickstart."))
- def refresh(self):
-# self.setCapsLockLabel()
- self.pw.grab_focus()
-
# Caps lock detection isn't hooked up right now
# def setCapsLockLabel(self):
# if isCapsLockEnabled():
@@ -150,5 +146,4 @@ class PasswordSpoke(FirstbootSpokeMixIn, NormalSpoke):
else:
self.clear_info()
self.set_warning(self._error)
- self.pw.grab_focus()
self.window.show_all()
diff --git a/pyanaconda/ui/gui/spokes/user.py b/pyanaconda/ui/gui/spokes/user.py
index 2c9cd1b..7fd65e6 100644
--- a/pyanaconda/ui/gui/spokes/user.py
+++ b/pyanaconda/ui/gui/spokes/user.py
@@ -449,6 +449,5 @@ class UserSpoke(FirstbootSpokeMixIn, NormalSpoke):
else:
self.clear_info()
self.set_warning(self._error)
- self.pw.grab_focus()
self.window.show_all()
--
1.8.1.2
11 years
[PATCH] Force a password to be set if option checked in TUI. (#927956)
by Samantha N. Bueno
Require a password either for root or the created admin user.
---
pyanaconda/ui/tui/spokes/user.py | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/ui/tui/spokes/user.py b/pyanaconda/ui/tui/spokes/user.py
index a6d36cb..ce53e1b 100644
--- a/pyanaconda/ui/tui/spokes/user.py
+++ b/pyanaconda/ui/tui/spokes/user.py
@@ -65,16 +65,26 @@ class UserSpoke(FirstbootSpokeMixIn, EditTUISpoke):
@property
def completed(self):
- return len(self.data.user.userList) > 0
+ """ Verify a user is created; verify pw is set if option checked. """
+ if len(self.data.user.userList) > 0:
+ if self.args._use_password and not bool(self.args.password or self.args.isCrypted):
+ return False
+ else:
+ return True
+ else:
+ return False
@property
def mandatory(self):
- return (not self.data.rootpw.password) or self.data.rootpw.lock
+ """ Only mandatory if root account is disabled. """
+ return not bool(self.data.rootpw.password) or self.data.rootpw.lock
@property
def status(self):
if len(self.data.user.userList) == 0:
return _("No user will be created")
+ elif self.args._use_password and not bool(self.args.password or self.args.isCrypted):
+ return _("You must set a password")
elif "wheel" in self.data.user.userList[0].groups:
return _("Administrator %s will be created") % self.data.user.userList[0].name
else:
--
1.7.11.7
11 years
[PATCH] Fix a minor display issue in TUI.
by Samantha N. Bueno
Always set completed status to True in the checkbox widgets of the
spoke display, this way the key is always visible.
---
pyanaconda/ui/tui/spokes/__init__.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/ui/tui/spokes/__init__.py b/pyanaconda/ui/tui/spokes/__init__.py
index b770351..134e303 100644
--- a/pyanaconda/ui/tui/spokes/__init__.py
+++ b/pyanaconda/ui/tui/spokes/__init__.py
@@ -78,7 +78,9 @@ class TUISpoke(TUIObject, tui.Widget, Spoke):
key = "x"
completed = self.completed
- c = tui.CheckboxWidget(key = key, completed = completed,
+ # always set completed = True here; otherwise key value won't be
+ # displayed if completed (spoke value from above) is False
+ c = tui.CheckboxWidget(key = key, completed = True,
title = self.title, text = self.status)
c.render(width)
self.draw(c)
--
1.7.11.7
11 years
[PATCH] hostname has dropped -v option
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
---
pyanaconda/network.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index 090141c..7487f32 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -672,7 +672,7 @@ def set_hostname(hn):
return
log.info("setting installation environment hostname to %s" % hn)
- iutil.execWithRedirect("hostname", ["-v", hn ])
+ iutil.execWithRedirect("hostname", [hn])
def write_hostname(rootpath, ksdata, overwrite=False):
cfgfile = os.path.normpath(rootpath + hostnameFile)
--
1.8.1.4
11 years
[PATCH] Only override proxy and noverifyssl if specified (#880482)
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
They were always getting overridden by the default cmdline values
instead of only being overridden if passed on the cmdline.
---
anaconda | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/anaconda b/anaconda
index 6076262..da12a04 100755
--- a/anaconda
+++ b/anaconda
@@ -907,8 +907,10 @@ if __name__ == "__main__":
kickstart.appendPostScripts(ksdata)
# cmdline flags override kickstart settings
- ksdata.method.proxy = anaconda.proxy
- ksdata.method.noverifyssl = flags.noverifyssl
+ if anaconda.proxy:
+ ksdata.method.proxy = anaconda.proxy
+ if flags.noverifyssl:
+ ksdata.method.noverifyssl = flags.noverifyssl
# set ksdata.method based on anaconda.method if it isn't already set
if anaconda.methodstr and not ksdata.method.method:
--
1.8.1.4
11 years
[PATCH] Use the firmware-provided language if it's something we support.
by Peter Jones
UEFI provides an easy method of checking what language is selected from
the firmware. This should match up with where the machine is sold, so
has a high chance of being a reasonable default.
Signed-off-by: Peter Jones <pjones(a)redhat.com>
---
pyanaconda/localization.py | 49 ++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 45 insertions(+), 4 deletions(-)
diff --git a/pyanaconda/localization.py b/pyanaconda/localization.py
index 38c5a76..4d6759e 100644
--- a/pyanaconda/localization.py
+++ b/pyanaconda/localization.py
@@ -24,6 +24,8 @@ import gettext
import locale as locale_mod
import os
import re
+import logging
+log = logging.getLogger("anaconda")
import babel
@@ -354,8 +356,11 @@ class Language(object):
self.translations = {repr(locale):locale
for locale in get_available_translations()}
self.locales = {repr(locale):locale for locale in get_all_locales()}
- self.preferred_translation = self.translations[DEFAULT_LANG]
- self.preferred_locales = [self.locales[DEFAULT_LANG]]
+
+ self.system_lang = self._get_firmware_language()
+ self.install_lang = self.system_lang
+ self.preferred_translation = self.translations[self.system_lang]
+ self.preferred_locales = [self.locales[self.system_lang]]
self.preferred_locale = self.preferred_locales[0]
self.all_preferences = preferences
@@ -364,8 +369,44 @@ class Language(object):
if self.territory:
self._get_preferred_translation_and_locales()
- self.install_lang = DEFAULT_LANG
- self.system_lang = DEFAULT_LANG
+ def _get_firmware_language(self):
+ try:
+ n = "/sys/firmware/efi/efivars/PlatformLang-8be4df61-93ca-11d2-aa0d-00e098032b8c"
+ d = open(n, 'r', 0).read()
+ except:
+ return DEFAULT_LANG
+
+ try:
+ # the contents of the file are:
+ # 4-bytes of attribute data that we don't care about
+ # NUL terminated ASCII string like 'en-US'.
+ if len(d) < 10:
+ log.debug("PlatformLang was too short")
+ raise ValueError
+ if d[2] != '-':
+ log.debug("PlatformLang was malformed")
+ raise ValueError
+
+ # they use - and we use _, so fix it...
+ d = d[:2] + '_' + d[3:]
+
+ # UEFI 2.3.1 Errata C specifies 2 aliases in common use that
+ # aren't part of RFC 4646, but are allowed in PlatformLang.
+ # Because why make anything simple?
+ if d.startswith('zh_chs'):
+ d = 'zh_Hans'
+ elif d.startswith('zh_cht'):
+ d = 'zh_Hant'
+ d += '.UTF-8'
+
+ if not self.translations.has_key(d):
+ log.debug("PlatformLang was \"%s\", which is unsupported." % d)
+ raise ValueError
+ log.debug("Using UEFI PlatformLang \"%s\" as our language." % d)
+ return d
+ except ValueError:
+ return DEFAULT_LANG
+
def _get_preferred_translation_and_locales(self):
# get locales from territory
locales_from_territory = PreferredLocale.from_territory(self.territory)
--
1.8.2.1
11 years
[PATCH] Do not allow passing empty NFS mount options to blivet.
by Chris Lumens
That'll end up with a string like "-o <server>:<dir>" which is clearly
wrong. It may not solve the real problem here, though.
Related: rhbz#958763, rhbz#959420
---
pyanaconda/image.py | 7 ++++++-
pyanaconda/packaging/__init__.py | 5 +++++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/image.py b/pyanaconda/image.py
index d415196..29367ca 100644
--- a/pyanaconda/image.py
+++ b/pyanaconda/image.py
@@ -148,9 +148,14 @@ def mountImageDirectory(method, storage):
url = "%s:%s" % (method.server, path)
+ if not method.options:
+ options = "nolock"
+ elif "nolock" not in method.options:
+ options += ",nolock"
+
while True:
try:
- blivet.util.mount(url, ISO_DIR, fstype="nfs", options=method.options)
+ blivet.util.mount(url, ISO_DIR, fstype="nfs", options=options)
except OSError as e:
log.error("couldn't mount ISO source directory: %s" % e)
exn = MediaMountError(str(e))
diff --git a/pyanaconda/packaging/__init__.py b/pyanaconda/packaging/__init__.py
index 27de538..ba60965 100644
--- a/pyanaconda/packaging/__init__.py
+++ b/pyanaconda/packaging/__init__.py
@@ -509,6 +509,11 @@ class Payload(object):
# mount the specified directory
url = "%s:%s" % (server, path)
+ if not options:
+ options = "nolock"
+ elif "nolock" not in method.options:
+ options += ",nolock"
+
try:
blivet.util.mount(url, mountpoint, fstype="nfs", options=options)
except OSError as e:
--
1.8.1.2
11 years
[anaconda]
by David Lehman
Patch 3 adds the ability to directly manage the sizes of containers
like lvm volume groups and btrfs volumes. See the commit message for
more detail.
I would really like to get this in before I go on vacation next week so
it can get some testing before the beta freeze. I have tested it quite a
bit, but I'm sure there are still bugs.
11 years
[blivet]
by David Lehman
Patch 4 adds the factory code for the container size policies used
by the container size management patch to anaconda I'll send in a few
minutes.
11 years
[master-post-alpha] Add current layout indication
by Vratislav Podzimek
These are the results of joint work of me and Máirín to implement layout
indication in Anaconda's GUI.
PATCH 1/3 adds a new Anaconda widget called LayoutIndicator. It is based on the
libxklavier library (no way to use the GNOME's replacement yet (if ever)) and
uses the XklEngine singleton instance to get information about layout switching,
configuration changes etc. I hope the code is vastly commented, but in case of
any doubts I'm glad to explain anything.
PATCH 2/3 adds the LayoutIndicator to our BaseWindow class, so that it appears
in the header of every spoke and hub. The patch also includes some changes that
create more space for the indicator and rearrange the heading a little bit.
Among the other things the red "beta warning" label became smaller. But for some
reason on the WelcomeSpoke it has the same size. Any ideas?
Anyway, that is the "global indicator". Since for dialogs we use lightboxing
that hides the underlying spoke/hub, we would need to place some more indicators
to places where they are needed. The only one so far seems to be the LUKS
passphrase dialog which is the case covered with PATCH 3/3.
The static preview can be seen at:
http://vpodzime.fedorapeople.org/making_room_for_LI_new.png
(the smaller indicator just shows the one that is used in the LUKS dialog)
Tomorrow I will also post a screencast I cannot record it now via SSH.
Vratislav Podzimek (3):
LayoutIndicator widget
Add layout indicator to the BaseWindow
Add layout indicator to the LUKS passphrase dialog
data/pixmaps/anaconda_spoke_header.png | Bin 185 -> 183 bytes
pyanaconda/ui/gui/spokes/lib/passphrase.glade | 19 +-
pyanaconda/ui/gui/spokes/lib/passphrase.py | 20 +-
widgets/configure.ac | 1 +
widgets/glade/AnacondaWidgets.xml | 10 +
widgets/src/BaseWindow.c | 15 +-
widgets/src/LayoutIndicator.c | 446 ++++++++++++++++++++++++++
widgets/src/LayoutIndicator.h | 78 +++++
widgets/src/Makefile.am | 8 +-
widgets/src/SpokeWindow.c | 4 +-
10 files changed, 578 insertions(+), 23 deletions(-)
create mode 100644 widgets/src/LayoutIndicator.c
create mode 100644 widgets/src/LayoutIndicator.h
--
1.7.11.7
11 years