summaryrefslogtreecommitdiffstats
path: root/iw
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2007-03-19 18:39:15 +0000
committerChris Lumens <clumens@redhat.com>2007-03-19 18:39:15 +0000
commit79822e57ee23be0ab363b425eafcf70996132588 (patch)
treeb361fde4cb89d86f8c8d0b2679675492aae3e687 /iw
parent52e5e2900d9534aae6aa84768a1ba9fe20ab1e03 (diff)
downloadanaconda-79822e57ee23be0ab363b425eafcf70996132588.tar.gz
anaconda-79822e57ee23be0ab363b425eafcf70996132588.tar.xz
anaconda-79822e57ee23be0ab363b425eafcf70996132588.zip
Updated for new system-config-date (#232905).
Diffstat (limited to 'iw')
-rw-r--r--iw/timezone_gui.py94
1 files changed, 7 insertions, 87 deletions
diff --git a/iw/timezone_gui.py b/iw/timezone_gui.py
index a31877dd9..33d20dfff 100644
--- a/iw/timezone_gui.py
+++ b/iw/timezone_gui.py
@@ -43,7 +43,7 @@ class TimezoneWindow(InstallWindow):
gtk.glade.set_custom_handler(self.custom_widget_handler)
# Set the default now. We'll fix it for real in getScreen.
- self.default = "America/New_York"
+ self.default = "America/New York"
self.zonetab = zonetab.ZoneTab()
@@ -52,11 +52,6 @@ class TimezoneWindow(InstallWindow):
self.vbox = self.xml.get_widget("tz_vbox")
self.utcCheckbox = self.xml.get_widget("utc_check")
self.notebook = self.xml.get_widget("notebook")
- self.tzActionLabel = self.xml.get_widget("tzActionLabel")
-
- # Need to set this after we've pulled in the glade file.
- self.tz.tzActionLabel = self.tzActionLabel
- self.tz.setActionLabelToMap()
ics.setTitle(_("Time Zone Selection"))
ics.setNextEnabled(1)
@@ -72,7 +67,6 @@ class TimezoneWindow(InstallWindow):
def timezone_widget_create (self, str1, str2, int1, int2):
mappath = "/usr/share/system-config-date/pixmaps/map1440.png"
- regionspath = "/usr/share/system-config-date/regions"
if gtk.gdk.screen_width() < 1024:
viewportWidth = 480
@@ -80,13 +74,13 @@ class TimezoneWindow(InstallWindow):
viewportWidth = 600
self.tz = AnacondaTZMap(self.zonetab, self.default, map=mappath,
- regions=regionspath, viewportWidth=viewportWidth)
+ viewportWidth=viewportWidth)
self.tz.show_all()
return self.tz
def getNext(self):
newzone = self.tz.getCurrent().tz
- self.timezone.setTimezoneInfo(newzone, self.utcCheckbox.get_active())
+ self.timezone.setTimezoneInfo(newzone.replace(" ", "_"), self.utcCheckbox.get_active())
return None
# TimezoneWindow tag="timezone"
@@ -101,6 +95,8 @@ class TimezoneWindow(InstallWindow):
if (string.find(self.default, "UTC") != -1):
self.default = "America/New_York"
+ self.default = self.default.replace("_", " ")
+
# Now fix the default we set when we made the timezone map widget.
self.tz.setCurrent(self.zonetab.findEntryByTZ(self.default))
self.utcCheckbox.set_active(asUTC)
@@ -111,30 +107,6 @@ class TimezoneWindow(InstallWindow):
self.notebook.remove(self.vbox)
return self.vbox
-# Only populate the combo box with cities that are in the zoom area or are
-# currently selected.
-def tzFilterFunc (model, iter, user_data):
- (longmin, latmin, longmax, latmax) = user_data.get_shown_region_long_lat()
-
- tz = user_data.zonetab.findEntryByTZ(model.get_value(iter, 1))
-
- # Allow the NoGeo timezones in all the time. No good reason for this,
- # but it has to be one way or the other.
- if tz.lat is None and tz.long is None:
- return True
-
- if tz.lat >= latmin and tz.lat <= latmax and tz.long >= longmin and tz.long <= longmax:
- return True
- elif user_data.currentEntry == None:
- if model.get_value(iter, 1) == "America/New_York":
- return True
- else:
- return False
- elif model.get_value(iter, 1) == user_data.currentEntry.tz:
- return True
- else:
- return False
-
class AnacondaTZMap(TimezoneMap):
def status_bar_init(self):
self.status = None
@@ -151,7 +123,7 @@ class AnacondaTZMap(TimezoneMap):
weight=pango.WEIGHT_BOLD)
self.markers[entry.tz] = marker
- if entry.tz == "America/New_York":
+ if entry.tz == "America/New York":
# In case the /etc/sysconfig/clock is messed up, use New
# York as the default.
self.fallbackEntry = entry
@@ -170,20 +142,13 @@ class AnacondaTZMap(TimezoneMap):
# populated, since otherwise we end up resorting on every addition.
self.tzSorted = gtk.TreeModelSort(self.tzStore)
self.tzSorted.set_sort_column_id(0, gtk.SORT_ASCENDING)
- self.tzFilter = self.tzSorted.filter_new()
- self.tzCombo = gtk.ComboBox(model=self.tzFilter)
+ self.tzCombo = gtk.ComboBox(model=self.tzSorted)
cell = gtk.CellRendererText()
self.tzCombo.pack_start(cell, True)
self.tzCombo.add_attribute(cell, 'text', 0)
- self.tzFilter.set_visible_func(tzFilterFunc, self)
self.tzCombo.connect("changed", self.selectionChanged)
self.hbox.pack_start(self.tzCombo, False, False)
- # Label for the currently pointed at/selected city.
- self.label = gtk.Label()
- self.label.set_line_wrap(True)
- self.hbox.pack_start(self.label, True, True, padding=5)
-
self.pack_start(self.hbox, False, False)
def selectionChanged(self, widget, *args):
@@ -191,50 +156,6 @@ class AnacondaTZMap(TimezoneMap):
entry = self.zonetab.findEntryByTZ(widget.get_model().get_value(iter, 1))
self.setCurrent(entry)
- def mapEvent (self, widget, event=None):
- TimezoneMap.mapEvent(self, widget, event)
-
- # We need to do this when the mouse pointer goes off the edge of the
- # world, not just leaves the map.
- if self.region and event.type == gtk.gdk.LEAVE_NOTIFY:
- self.setLabel(self.currentEntry.tz, self.currentEntry.comments)
-
- def overviewPressEvent(self):
- TimezoneMap.overviewPressEvent(self)
- self.tzFilter.refilter()
-
- def zoomMoveEvent(self, event):
- x1, y1 = self.canvas.root ().w2i (event.x, event.y)
- long, lat = self.canvas2map (x1, y1)
- r = self.region
- longmin, latmin, longmax, latmax = self.get_shown_region_long_lat ()
- last = self.highlightedEntry
- self.highlightedEntry = self.zonetab.findNearest(long, lat, longmin, latmin, longmax, latmax)
-
- if self.highlightedEntry:
- x2, y2 = self.map2canvas(self.highlightedEntry.lat,
- self.highlightedEntry.long)
- self.arrow.set(points=(x1, y1, x2, y2))
- self.arrow.show ()
- self.setLabel(self.highlightedEntry.tz, self.highlightedEntry.comments)
- else:
- self.arrow.hide ()
- self.setLabel(self.currentEntry.tz, self.currentEntry.comments)
-
- def zoomPressEvent(self, event):
- TimezoneMap.zoomPressEvent(self, event)
-
- if event.button == 1:
- self.tzFilter.refilter()
-
- def setLabel(self, tz, comments=None):
- if comments != None:
- labelText = "%s - %s" % (tz, comments)
- else:
- labelText = tz
-
- self.label.set_text(labelText)
-
def updateTimezoneList(self):
# Find the currently selected item in the combo box and update both
# the combo and the comment label.
@@ -242,7 +163,6 @@ class AnacondaTZMap(TimezoneMap):
while iter:
if self.tzCombo.get_model().get_value(iter, 1) == self.currentEntry.tz:
self.tzCombo.set_active_iter(iter)
- self.setLabel(self.currentEntry.tz, self.currentEntry.comments)
break
iter = self.tzCombo.get_model().iter_next(iter)