[PATCH 2/5] Try to preset the timezone to the language-related one

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Once we have a GeoIP available, we should use it for guessing
right timezone, but for now, try to use the chosen language.
---
 pyanaconda/ui/gui/spokes/datetime_spoke.py |    2 +-
 pyanaconda/ui/gui/spokes/welcome.py        |    7 +++++++
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.py b/pyanaconda/ui/gui/spokes/datetime_spoke.py
index 82515ea..4a33b42 100644
--- a/pyanaconda/ui/gui/spokes/datetime_spoke.py
+++ b/pyanaconda/ui/gui/spokes/datetime_spoke.py
@@ -132,7 +132,7 @@ class DatetimeSpoke(NormalSpoke):
         self._start_updating_timer_id = None
 
         if self.data.timezone.timezone:
-            self._tzmap.emit("timezone-changed", self.data.timezone.timezone)
+            self._tzmap.set_timezone(self.data.timezone.timezone)
 
     def add_to_store(self, store, item):
         store.append([item])
diff --git a/pyanaconda/ui/gui/spokes/welcome.py b/pyanaconda/ui/gui/spokes/welcome.py
index 8f82745..279027b 100644
--- a/pyanaconda/ui/gui/spokes/welcome.py
+++ b/pyanaconda/ui/gui/spokes/welcome.py
@@ -29,6 +29,7 @@ from pyanaconda.ui.gui.utils import enlightbox
 from pyanaconda.localization import Language, LOCALE_PREFERENCES
 from pyanaconda.product import productName, productVersion
 from pyanaconda import xklavier
+from pyanaconda import localization
 
 __all__ = ["WelcomeLanguageSpoke"]
 
@@ -70,6 +71,12 @@ class WelcomeLanguageSpoke(StandaloneSpoke):
             if layout not in self.data.keyboard.layouts_list:
                 self.data.keyboard.layouts_list.append(layout)
 
+        #TODO: better use GeoIP data once it is available
+        if self.language.territory and not self.data.timezone.timezone:
+            lang_timezone = localization.get_preferred_timezone(self.language.territory)
+            if lang_timezone:
+                self.data.timezone.timezone = lang_timezone
+
     @property
     def completed(self):
         return self.data.lang.lang and self.data.lang.lang != ""
-- 
1.7.4.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux