Bug 3018: ImportGrdb: remove calls to keys() dictionary method where possible
svn: r12572
This commit is contained in:
@@ -210,20 +210,17 @@ class DocReportDialog(ReportDialog):
|
||||
yoptions=gtk.SHRINK)
|
||||
|
||||
self.template_combo = gtk.combo_box_new_text()
|
||||
tlist = _template_map.keys()
|
||||
tlist.sort()
|
||||
tlist = sorted(_template_map)
|
||||
|
||||
template_name = self.options.handler.get_template_name()
|
||||
|
||||
self.template_combo.append_text(_default_template)
|
||||
template_index = 1
|
||||
active_index = 0
|
||||
for template in tlist:
|
||||
for template_index, template in enumerate(sorted(_template_map)):
|
||||
if template != _user_template:
|
||||
self.template_combo.append_text(template)
|
||||
if _template_map[template] == os.path.basename(template_name):
|
||||
active_index = template_index
|
||||
template_index = template_index + 1
|
||||
self.template_combo.append_text(_user_template)
|
||||
|
||||
self.template_combo.connect('changed',self.html_file_enable)
|
||||
|
||||
@@ -59,18 +59,14 @@ class StyleComboBox(gtk.ComboBox):
|
||||
self.store = gtk.ListStore(gobject.TYPE_STRING)
|
||||
self.set_model(self.store)
|
||||
self.style_map = style_map
|
||||
keys = style_map.keys()
|
||||
keys.sort()
|
||||
index = 0
|
||||
start_index = 0
|
||||
for key in keys:
|
||||
for index, key in enumerate(sorted(style_map)):
|
||||
if key == "default":
|
||||
self.store.append(row=[_('default')])
|
||||
else:
|
||||
self.store.append(row=[key])
|
||||
if key == default:
|
||||
start_index = index
|
||||
index += 1
|
||||
|
||||
self.set_active(start_index)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user