diff options
author | Chris Lumens <clumens@redhat.com> | 2006-02-02 16:55:48 +0000 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2006-02-02 16:55:48 +0000 |
commit | eb6b3af7afde0e5760a5d13d2a63d23b1c0e0fb0 (patch) | |
tree | eb9cf531c558d57a5ce97f215c32b01e0d572c13 /iw/timezone_gui.py | |
parent | bdc0b33915cb764c1fa187b92210e7ff90ac7930 (diff) | |
download | anaconda-eb6b3af7afde0e5760a5d13d2a63d23b1c0e0fb0.tar.gz anaconda-eb6b3af7afde0e5760a5d13d2a63d23b1c0e0fb0.tar.xz anaconda-eb6b3af7afde0e5760a5d13d2a63d23b1c0e0fb0.zip |
Speed up timezone screen loading.
Diffstat (limited to 'iw/timezone_gui.py')
-rw-r--r-- | iw/timezone_gui.py | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/iw/timezone_gui.py b/iw/timezone_gui.py index 511e37ea0..82a237190 100644 --- a/iw/timezone_gui.py +++ b/iw/timezone_gui.py @@ -129,21 +129,9 @@ class AnacondaTZMap(TimezoneMap): def status_bar_init(self): self.status = None - def timezone_list_init (self, default): - self.hbox = gtk.HBox() - self.tzStore = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, - gobject.TYPE_INT, gobject.TYPE_INT) - 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) - cell = gtk.CellRendererText() - self.tzCombo.pack_start(cell, True) - self.tzCombo.add_attribute(cell, 'text', 0) - self.tzFilter.set_visible_func(tzFilterFunc, self) + def load_entries (self, root): + iter = self.tzStore.get_iter_first() - root = self.canvas.root() - for entry in self.zonetab.getEntries(): if entry.lat is None or entry.long is None: continue @@ -159,12 +147,28 @@ class AnacondaTZMap(TimezoneMap): #In case the /etc/sysconfig/clock is messed up, use New York as default self.fallbackEntry = entry - iter = self.tzStore.append() - self.tzStore.set_value(iter, 0, _(entry.tz)) - self.tzStore.set_value(iter, 1, entry.tz) - self.tzStore.set_value(iter, 2, entry.lat) - self.tzStore.set_value(iter, 3, entry.long) + iter = self.tzStore.insert_after(iter, [_(entry.tz), entry.tz, + entry.lat, entry.long]) + def timezone_list_init (self, default): + self.hbox = gtk.HBox() + self.tzStore = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, + gobject.TYPE_INT, gobject.TYPE_INT) + + root = self.canvas.root() + + self.load_entries(root) + + # Add the ListStore to the sorted model after the list has been + # 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) + 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) |