diff options
author | Chris Lumens <clumens@redhat.com> | 2007-01-25 21:26:43 +0000 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2007-01-25 21:26:43 +0000 |
commit | d351a0ed189b39272d8ac0b124d371a6093c3a67 (patch) | |
tree | 9bbe9153f77141a0e7275d1bb5b55f5f86d87fb6 /iw | |
parent | 7dcbabeadce1da38d9e417264c7a34353f834714 (diff) | |
download | anaconda-d351a0ed189b39272d8ac0b124d371a6093c3a67.tar.gz anaconda-d351a0ed189b39272d8ac0b124d371a6093c3a67.tar.xz anaconda-d351a0ed189b39272d8ac0b124d371a6093c3a67.zip |
Give some indication of what city is currently being pointed at (#219417).
Diffstat (limited to 'iw')
-rw-r--r-- | iw/timezone_gui.py | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/iw/timezone_gui.py b/iw/timezone_gui.py index 134d6123b..1c9e4c62d 100644 --- a/iw/timezone_gui.py +++ b/iw/timezone_gui.py @@ -179,9 +179,9 @@ class AnacondaTZMap(TimezoneMap): self.tzCombo.connect("changed", self.selectionChanged) self.hbox.pack_start(self.tzCombo, False, False) - # Label for the comment (if there is one) - self.commentLabel = gtk.Label() - self.hbox.pack_start(self.commentLabel, True, True, padding=5) + # Label for the currently pointed at/selected city. + self.label = gtk.Label() + self.hbox.pack_start(self.label, True, True, padding=5) self.pack_start(self.hbox, False, False) @@ -190,6 +190,14 @@ 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() @@ -207,8 +215,10 @@ class AnacondaTZMap(TimezoneMap): 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) @@ -216,6 +226,14 @@ class AnacondaTZMap(TimezoneMap): 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. @@ -223,11 +241,7 @@ class AnacondaTZMap(TimezoneMap): while iter: if self.tzCombo.get_model().get_value(iter, 1) == self.currentEntry.tz: self.tzCombo.set_active_iter(iter) - - if self.currentEntry.comments != None: - self.commentLabel.set_text(self.currentEntry.comments) - else: - self.commentLabel.set_text("") - + self.setLabel(self.currentEntry.tz, self.currentEntry.comments) break + iter = self.tzCombo.get_model().iter_next(iter) |