Skip to content

Commit

Permalink
part of #431-#446 - wip
Browse files Browse the repository at this point in the history
  • Loading branch information
mfrasca committed Oct 11, 2018
1 parent 62b7702 commit b89d999
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions bauble/plugins/report/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,14 +605,20 @@ def add_name_to_combo_and_select_it(self, name, plugin, is_package_template):
'''

new_row = (name[:-len(plugin.extension)], plugin.title, is_package_template, plugin.extension, )

names_ls = self.view.widgets.names_ls
for n, row in enumerate(names_ls):
if row[1] < plugin.title:
continue
if row[0] < name:
continue
break
names_ls.insert(n, (name[:-len(plugin.extension)], plugin.title, is_package_template, plugin.extension, ))
item = names_ls.get_iter_first()
for row in names_ls:
if row[1] >= plugin.title and row[0] >= name:
break
item = names_ls.iter_next(item)
if row[1] == plugin.title and row[0] == name:
names_ls.set(item, [2], [False])
elif item:
names_ls.insert_before(item, new_row)
else:
names_ls.append(new_row)
GObject.idle_add(self.view.widget_set_value, 'names_combo', name)

def populate_names_combo(self):
Expand Down

0 comments on commit b89d999

Please sign in to comment.