make enabled sites come first in drop-down (i.e. more chance of the default being the one you want)

This commit is contained in:
sqlcoder 2010-02-04 23:08:09 +00:00
parent b2e409ae00
commit 4d45bd39d3

View File

@ -243,7 +243,17 @@ class GuiBulkImport():
# ComboBox - filter # ComboBox - filter
self.cbfilter = gtk.combo_box_new_text() self.cbfilter = gtk.combo_box_new_text()
disabled_sites = [] # move disabled sites to bottom of list
for w in self.config.hhcs: for w in self.config.hhcs:
try:
if self.config.supported_sites[w].enabled: # include enabled ones first
print w
self.cbfilter.append_text(w)
else:
disabled_sites.append(w)
except: # self.supported_sites[w] may not exist if hud_config is bad
disabled_sites.append(w)
for w in disabled_sites: # then disabled ones
print w print w
self.cbfilter.append_text(w) self.cbfilter.append_text(w)
self.cbfilter.set_active(0) self.cbfilter.set_active(0)