Skip to content

Commit

Permalink
Eliminate warnings in array editor
Browse files Browse the repository at this point in the history
This fixes the test failure in test_arrayeditor_with_inf_array.
  • Loading branch information
jitseniesen committed Jan 3, 2024
1 parent 65944e4 commit c0a1cd1
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions spyder/plugins/variableexplorer/widgets/arrayeditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,9 @@ def setEditorData(self, editor, index):
#TODO: Implement "Paste" (from clipboard) feature
class ArrayView(QTableView, SpyderWidgetMixin):
"""Array view class"""

CONF_SECTION = 'variable_explorer'

def __init__(self, parent, model, dtype, shape):
QTableView.__init__(self, parent)

Expand Down Expand Up @@ -735,7 +738,9 @@ def do_nothing():
text=_('Refresh'),
icon=self.create_icon('refresh'),
tip=_('Refresh editor with current value of variable in console'),
triggered=self.refresh)
triggered=self.refresh,
register_action=False
)
self.refresh_action.setDisabled(self.data_function is None)
toolbar.add_item(self.refresh_action)

Expand All @@ -744,22 +749,28 @@ def do_nothing():
text=_('Format'),
icon=self.create_icon('format_float'),
tip=_('Set format of floating-point numbers'),
triggered=do_nothing)
triggered=do_nothing,
register_action=False
)
toolbar.add_item(self.format_action)

self.resize_action = self.create_action(
ArrayEditorActions.Resize,
text=_('Resize'),
icon=self.create_icon('collapse_column'),
tip=_('Resize columns to contents'),
triggered=do_nothing)
triggered=do_nothing,
register_action=False
)
toolbar.add_item(self.resize_action)

self.toggle_bgcolor_action = self.create_action(
ArrayEditorActions.ToggleBackgroundColor,
text=_('Background color'),
icon=self.create_icon('background_color'),
toggled=do_nothing)
toggled=do_nothing,
register_action=False
)
toolbar.add_item(self.toggle_bgcolor_action)

toolbar._render()
Expand Down

0 comments on commit c0a1cd1

Please sign in to comment.