Skip to content

Commit c770d07

Browse files
Update class_file_manager.py
Adapt to new /models
1 parent 348ba40 commit c770d07

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

annotation_tool/controllers/classification/class_file_manager.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ def load_project(self, data, file_path):
7676

7777
self.model.current_json_path = file_path
7878
self.model.json_loaded = True
79+
80+
# [MV Note] populate_action_tree now uses self.main.tree_model internally
7981
self.main.populate_action_tree()
8082
self.main.update_save_export_button_state()
8183

@@ -195,10 +197,13 @@ def create_new_project(self):
195197
self.ui.show_classification_view()
196198

197199
def _clear_workspace(self, full_reset=False):
198-
self.ui.classification_ui.left_panel.tree.clear()
200+
# [MV Fix] Clear the Model, not the View
201+
# self.ui.classification_ui.left_panel.tree.clear() # Old QTreeWidget code
202+
self.main.tree_model.clear()
203+
199204
self.model.reset(full_reset)
200205
self.main.update_save_export_button_state()
201206
self.ui.classification_ui.right_panel.manual_box.setEnabled(False)
202207
self.ui.classification_ui.center_panel.show_single_view(None)
203208
if full_reset:
204-
self.main.setup_dynamic_ui()
209+
self.main.setup_dynamic_ui()

0 commit comments

Comments
 (0)