Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def _store(self, *args, **kwargs):

def store(self):
for pick, pl in self.picks_map.items():
if pick.from_tool:
if pick.from_tool or pick.read_only:
continue

points = []
Expand Down Expand Up @@ -318,7 +318,7 @@ def show_particles_from_picks(self, picks: CopickPicks):
volume = None

# Have to call this now to set before OPTIONS_PARTLIST_CHANGED is triggered
partlist.editing_locked = picks.from_tool
partlist.editing_locked = picks.from_tool or picks.read_only

self.session.ArtiaX.add_particlelist(partlist)

Expand All @@ -345,7 +345,7 @@ def show_particles_from_picks(self, picks: CopickPicks):
partlist.hide_markers()
partlist.hide_axes()

if picks.from_tool:
if picks.from_tool or picks.read_only:
lock_particlelist([partlist], True, "all", True)

run(self.session, "artiax cap true", log=False)
Expand Down
2 changes: 1 addition & 1 deletion src/ui/QUnifiedTable.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def _on_selection_changed(self, selected, deselected):
source_index = self._filter_model.mapToSource(proxy_index) if self._filter_model else proxy_index

entity = self._source_model.get_entity(source_index)
if entity and not getattr(entity, "from_tool", False):
if entity and not (entity.from_tool or entity.read_only):
can_delete = True

self._delete_button.setEnabled(can_delete)
Expand Down
4 changes: 2 additions & 2 deletions src/ui/QUnifiedTableModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def data(self, index, role=Qt.DisplayRole):
if role == Qt.DisplayRole:
if column == 0:
# Show user/tool name with lock/unlock indicator
access_indicator = "🔒" if entity.entity.from_tool else "✏️"
access_indicator = "🔒" if (entity.entity.from_tool or entity.entity.read_only) else "✏️"
return f"{access_indicator} {entity.data(0)}"
elif column == 1:
return entity.data(1)
Expand All @@ -106,7 +106,7 @@ def data(self, index, role=Qt.DisplayRole):

elif role == Qt.ToolTipRole:
if column == 0:
if entity.entity.from_tool:
if entity.entity.from_tool or entity.entity.read_only:
return f"Tool-generated entity (read-only): {entity.data(0)}"
else:
return f"User-generated entity (editable): {entity.data(0)}"
Expand Down