Skip to content

Commit

Permalink
Bug fix and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
manuvarkey committed Sep 4, 2023
1 parent dd12264 commit 8ea03ce
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions gelectrical/view/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ def update_from_database(self, data_path):
category_iter = self.store.append(None, [category, category])
for element in element_dict:
item_iter = self.store.append(category_iter, [element, category])
# self.tree.expand_all()
if len(self.data) == 1:
self.tree.expand_all()
else:
self.data_path = None
self.data = dict()
Expand All @@ -144,6 +145,7 @@ def run_dialog(self, button):
if self.data_path:
# Run dialog
self.dialog_window.show_all()
self.search_bar.set_search_mode(True)
response = self.dialog_window.run()

if response == Gtk.ResponseType.OK:
Expand All @@ -152,8 +154,8 @@ def run_dialog(self, button):
if selection.count_selected_rows() != 0: # if selection exists
[model, paths] = selection.get_selected_rows()
item_iter = paths[-1]
item_name = self.store[item_iter][0]
item_category = self.store[item_iter][1]
item_name = self.filter[item_iter][0]
item_category = self.filter[item_iter][1]
if item_name != item_category:
item = self.data[item_category][item_name]
validated_dict = dict()
Expand Down

0 comments on commit 8ea03ce

Please sign in to comment.