Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Edubuntu User (http://www.linux-archive.org/edubuntu-user/)
-   -   Change timezone on the map when a different city is chosen (http://www.linux-archive.org/edubuntu-user/651776-change-timezone-map-when-different-city-chosen.html)

Vratislav Podzimek 04-02-2012 03:13 PM

Change timezone on the map when a different city is chosen
 
---
pyanaconda/ui/gui/spokes/datetime_spoke.py | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.py b/pyanaconda/ui/gui/spokes/datetime_spoke.py
index c519571..488642e 100644
--- a/pyanaconda/ui/gui/spokes/datetime_spoke.py
+++ b/pyanaconda/ui/gui/spokes/datetime_spoke.py
@@ -196,7 +196,24 @@ class DatetimeSpoke(NormalSpoke):
self._citiesFilter.refilter()

def on_city_changed(self, *args):
- pass
+ timezone = None
+
+ regions_model = self._regionCombo.get_model()
+ regions_iter = self._regionCombo.get_active_iter()
+ region = regions_model[regions_iter][0]
+
+ cities_model = self._cityCombo.get_model()
+ cities_iter = self._cityCombo.get_active_iter()
+ if cities_iter: #there can be no city selected
+ city = cities_model[cities_iter][0]
+ else:
+ city = None
+
+ if city and region:
+ timezone = region + "/" + city
+
+ if timezone and (self._tzmap.get_timezone() != timezone):
+ self._tzmap.set_timezone(timezone)

def on_month_changed(self, *args):
self._daysFilter.refilter()
--
1.7.4.4

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


All times are GMT. The time now is 09:29 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.