From 4d45bd39d3b18c83b55637f38ee6ec6f8cbc6e83 Mon Sep 17 00:00:00 2001 From: sqlcoder Date: Thu, 4 Feb 2010 23:08:09 +0000 Subject: [PATCH] make enabled sites come first in drop-down (i.e. more chance of the default being the one you want) --- pyfpdb/GuiBulkImport.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pyfpdb/GuiBulkImport.py b/pyfpdb/GuiBulkImport.py index 96842134..84828493 100755 --- a/pyfpdb/GuiBulkImport.py +++ b/pyfpdb/GuiBulkImport.py @@ -243,7 +243,17 @@ class GuiBulkImport(): # ComboBox - filter self.cbfilter = gtk.combo_box_new_text() + disabled_sites = [] # move disabled sites to bottom of list 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 self.cbfilter.append_text(w) self.cbfilter.set_active(0)