Skip to content

Commit

Permalink
Fixed bug where combo-boxes wouldn't be set correctly on handler load
Browse files Browse the repository at this point in the history
  • Loading branch information
Laharah committed Apr 26, 2017
1 parent 95e1f28 commit 763544e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 5 additions & 3 deletions filebottool/gtkui/handler_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class HandlerUI(object):
download_subs_checkbox
encoding_entry
language_code_entry
subs_language_entry
"""
def __init__(self, glade, settings=None):
"""
Expand Down Expand Up @@ -104,9 +105,10 @@ def populate_with_settings(self, settings):
log.debug("Setting combo boxes")
for combo, value in combo_value_pairs:
combo_model = combo.get_model()
value_index = [index for index, row in enumerate(combo_model)
if row[0] == value][0]
if not value_index:
try:
value_index = [index for index, row in enumerate(combo_model)
if row[0] == value][0]
except IndexError:
log.warning("could not set {0} to value {1}, value {1} could "
"not be found in {0}".format(combo, value))
else:
Expand Down
1 change: 0 additions & 1 deletion filebottool/gtkui/rename_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,4 +415,3 @@ def swap_spinner(self, *args):
spinner.show()
spinner.start()
hide.hide()

0 comments on commit 763544e

Please sign in to comment.