Skip to content

Commit

Permalink
Hook up help; unchosen cells weren't losing their diamond highlight; …
Browse files Browse the repository at this point in the history
…diabled chosen-cell content menu if no chosen cells
  • Loading branch information
e-pettersen committed Dec 28, 2024
1 parent b7b40d0 commit c9e4436
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/bundles/profile_grids/bundle_info.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<BundleInfo name="ChimeraX-ProfileGrids" version="1.0"
<BundleInfo name="ChimeraX-ProfileGrids" version="1.0.1"
package="chimerax.profile_grids"
minSessionVersion="1" maxSessionVersion="1">

Expand Down
8 changes: 2 additions & 6 deletions src/bundles/profile_grids/src/grid_canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ def mouse_click(self, event):
else:
if not shifted:
for item in self.chosen_cells.values():
item.hide()
self.main_scene.removeItem(item)
self.chosen_cells.clear()
from Qt.QtGui import QPen, QColor, QPolygonF
Expand Down Expand Up @@ -563,13 +564,8 @@ def __init__(self, session, seqs):
button_layout.addWidget(centering_widget, alignment=Qt.AlignCenter)

from Qt.QtWidgets import QDialogButtonBox as qbbox
bbox = qbbox(qbbox.Close | qbbox.Help)
bbox = qbbox(qbbox.Close)
bbox.rejected.connect(self.close)
if self.help:
from chimerax.core.commands import run
bbox.helpRequested.connect(lambda *, run=run, ses=self.session: run(ses, "help " + self.help))
else:
bbox.button(qbbox.Help).setEnabled(False)
layout.addWidget(bbox)

self.setLayout(layout)
Expand Down
4 changes: 2 additions & 2 deletions src/bundles/profile_grids/src/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
class ProfileGridsTool(ToolInstance):
""" Viewer displays a multiple sequence alignment as a grid/table """

#help = "help:user/tools/sequenceviewer.html"
help = None
help = "help:user/tools/profilegrid.html"

def __init__(self, session, tool_name, alignment=None):
""" if 'alignment' is None, then we are being restored from a session and
Expand Down Expand Up @@ -102,6 +101,7 @@ def fill_context_menu(self, menu, x, y):
action = QAction("List Sequence Names", cell_menu)
action.triggered.connect(lambda *args, f=self.grid_canvas.list_from_cells: f())
cell_menu.addAction(action)
cell_menu.setEnabled(bool(self.grid_canvas.chosen_cells))
alignment_menu = cell_menu.addMenu("New Alignment")
viewers = self.session.alignments.registered_viewers("alignment")
viewers.sort()
Expand Down

0 comments on commit c9e4436

Please sign in to comment.