Skip to content

Commit

Permalink
Add window tools to table viewer. Don't initially state title from LA…
Browse files Browse the repository at this point in the history
…BEL.
  • Loading branch information
Carifio24 committed May 25, 2023
1 parent fe49475 commit b996115
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 0 additions & 1 deletion glue/viewers/common/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ def __init__(self, session, state=None):
# the current state of the viewer
self.state = state or self._state_cls()
self.state.data_collection = session.data_collection
self.state.title = self.state.title or self.LABEL

# Create the layer artist container, which is the object in which
# we will add LayerArtist objects
Expand Down
9 changes: 7 additions & 2 deletions glue/viewers/table/qt/data_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,10 @@ class TableViewer(DataViewer):
_state_cls = TableViewerState

inherit_tools = False
tools = ['table:rowselect']
tools = ['table:rowselect', 'window']
subtools = {
'window': ['window:movetab', 'window:title']
}

def __init__(self, session, state=None, parent=None, widget=None):

Expand Down Expand Up @@ -377,7 +380,9 @@ def add_subset(self, subset):

@property
def window_title(self):
if len(self.state.layers) > 0:
if self.state.title:
return self.state.title
elif len(self.state.layers) > 0:
return 'Table: ' + self.state.layers[0].layer.label
else:
return 'Table'
Expand Down

0 comments on commit b996115

Please sign in to comment.