From 6ed8ae98a2b2263a83a2c0933772d69b53e96e70 Mon Sep 17 00:00:00 2001 From: Hongxu Jia Date: Sat, 29 Jun 2019 17:01:53 +0800 Subject: [PATCH] tweak time setting - Unify the gui and tui with the same default timezone setting - The tui not support NTP server setting Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia Rebase for anaconda 34. Signed-off-by: Kai Kang Rebase for anaconda 37. Signed-off-by: Kai Kang --- pyanaconda/core/constants.py | 2 ++ pyanaconda/ui/gui/spokes/datetime_spoke.py | 2 +- pyanaconda/ui/tui/spokes/time_spoke.py | 7 +------ 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/pyanaconda/core/constants.py b/pyanaconda/core/constants.py index b130f71fd9..70f677f304 100644 --- a/pyanaconda/core/constants.py +++ b/pyanaconda/core/constants.py @@ -76,6 +76,8 @@ DEFAULT_KEYBOARD = "us" DRACUT_SHUTDOWN_EJECT = "/run/initramfs/usr/lib/dracut/hooks/shutdown/99anaconda-eject.sh" +DEFAULT_TZ = "America/New_York" + # VNC questions USEVNC = N_("Start VNC") USETEXT = N_("Use text mode") diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.py b/pyanaconda/ui/gui/spokes/datetime_spoke.py index 2e0bc2ec21..c92c227700 100644 --- a/pyanaconda/ui/gui/spokes/datetime_spoke.py +++ b/pyanaconda/ui/gui/spokes/datetime_spoke.py @@ -58,7 +58,7 @@ log = get_module_logger(__name__) __all__ = ["DatetimeSpoke"] -DEFAULT_TZ = "America/New_York" +DEFAULT_TZ = constants.DEFAULT_TZ SPLIT_NUMBER_SUFFIX_RE = re.compile(r'([^0-9]*)([-+])([0-9]+)') diff --git a/pyanaconda/ui/tui/spokes/time_spoke.py b/pyanaconda/ui/tui/spokes/time_spoke.py index 755ea9043a..8a31913ef5 100644 --- a/pyanaconda/ui/tui/spokes/time_spoke.py +++ b/pyanaconda/ui/tui/spokes/time_spoke.py @@ -125,7 +125,7 @@ class TimeSpoke(FirstbootSpokeMixIn, NormalTUISpoke): if kickstart_timezone: return _("%s timezone") % kickstart_timezone else: - return _("Timezone is not set.") + return _("%s timezone") % constants.DEFAULT_TZ def _summary_text(self): """Return summary of current timezone & NTP configuration. @@ -172,11 +172,6 @@ class TimeSpoke(FirstbootSpokeMixIn, NormalTUISpoke): callback=self._timezone_callback ) - self._container.add( - TextWidget(_("Configure NTP servers")), - callback=self._configure_ntp_server_callback - ) - self.window.add_with_separator(self._container) def _timezone_callback(self, data): -- 2.7.4