Ticket #9796 (closed: fixed)

Opened 6 years ago

Last modified 5 years ago

Hide the sort option for table workspaces

Reported by: Nick Draper Owned by: Nick Draper
Priority: critical Milestone: Release 3.2
Component: GUI Keywords:
Cc: Blocked By:
Blocking: Tester: Peter Parker

Description (last modified by Nick Draper) (diff)

1) Create a workspace as follows:

table = CreateEmptyTableWorkspace()
table.addColumn('double', 'a')
table.addColumn('str', 'b')
table.addRow([1.0, "x"])
table.addRow([4.0, "y"])
table.addRow([2.0, "z"])

2) Open the table in MantidPlot

3) Right-click the table and go to 'Sort Table'. Try to sort the table either Ascending or Descending by column 'a'. Nothing Happens!

It doesn't work, so don't offer it.

Change History

comment:1 Changed 6 years ago by Nick Draper

  • Status changed from new to assigned

comment:2 Changed 6 years ago by Nick Draper

  • Owner changed from Roman Tolchenov to Nick Draper

comment:3 Changed 6 years ago by Nick Draper

  • Description modified (diff)

comment:4 Changed 6 years ago by Nick Draper

Test cases:

  1. A normal qtiplot table File->New->New Table (this should have all the options available)
  2. a Simple mantid tableworkspace (This should have read only options + delete row and no sorting)
    table = CreateEmptyTableWorkspace()
    table.addColumn('double', 'a')
    table.addColumn('str', 'b')
    table.addRow([1.0, "x"])
    table.addRow([4.0, "y"])
    table.addRow([2.0, "z"])
    
  3. A peaks workspace (this should have read only options + delete row, and sorting)
    # Create a run workspace
    ws = CreateSampleWorkspace()
    # Create a peaks workspace
    pws = CreatePeaksWorkspace(ws)
    
    # Add two peaks to the peaks workspace
    AddPeak( pws, ws, TOF=100, DetectorID=101, Height=1 )
    AddPeak( pws, ws, TOF=200, DetectorID=102, Height=2 )
    
Last edited 6 years ago by Nick Draper (previous) (diff)

comment:5 Changed 6 years ago by Nick Draper

  • Status changed from assigned to inprogress

Make context menu entries optional based on table contents. re #9796

Changeset: b1cd164ad3054153eb412fd0ac480e777e0fe54a

comment:6 Changed 6 years ago by Nick Draper

  • Status changed from inprogress to verify
  • Resolution set to fixed

To Test

  1. This code touches ApplicationWindow albeit in a minor way, so start with a code review.
  2. For each of the test cases in comment 4, Check the right click context menu options for:
    1. cells
    2. rows
    3. columns
    4. the blank part of the table

comment:7 Changed 6 years ago by Nick Draper

resolving cppcheck warning - unused variable. re #9796

Changeset: b4d3e0a61fb1a5c756c6236effd02c2e52281bc4

comment:8 Changed 6 years ago by Peter Parker

  • Status changed from verify to verifying
  • Tester set to Peter Parker

comment:9 Changed 6 years ago by Peter Parker

  • Status changed from verifying to reopened
  • Resolution fixed deleted

Test Case 1

Looks fine to me.

Test Case 2

  • Rows - Most of the options available here when first displaying the table probably shouldn't be. Weirdly, double-clicking a column and then going back to the right-click menu for a row then displays less options.
  • Cells - "Cut", "Paste", "Recalculate", "Clear" and "Set Column Values..." are all still options.
  • Blank Part - "Add Column" and "Clear" are still options.

Test Case 3

  • Cells and Blank Part - These still have writeable options that throw up dialogs or cause a crash, depending on which cell is being used, or whereabouts in the blank space you click.

It seems like the blank part of the table below the data acts differently to the blank part to the right of the data. Should this be the case?

Also, as well as the right-click menus, there is still the problem of the "Table" menu in Mantid's main menu bar. I realise this was probably out of the scope of this ticket, but I can engineer a couple of crashes using the available options there.

comment:10 Changed 6 years ago by Nick Draper

  • Status changed from reopened to inprogress

Resolved testing comments by Peter. re #9796

Changeset: afb890bff658e5e7352412601939cd3a9cae285c

comment:11 Changed 6 years ago by Nick Draper

  • Status changed from inprogress to verify
  • Resolution set to fixed

comment:12 Changed 6 years ago by Peter Parker

  • Status changed from verify to verifying

comment:13 Changed 6 years ago by Peter Parker

  • Status changed from verifying to reopened
  • Resolution fixed deleted

I can engineer one last crash by doing exactly the following:

  • Generate the PeaksWorkspace using the script for test case 3.
  • Open up the table, and expand the window so you can see the blank space to the right of the data.
  • Select the h[Y] column (which is not read-only).
  • Right-click the blank space to the right of the data. There is an "Add Column" option which, when clicked, causes a crash.

Note that had you clicked one of the read-only columns first, the option would not be available.

comment:14 Changed 6 years ago by Nick Draper

  • Status changed from reopened to inprogress

Fix for obscure usage of drop down menus. re #9796

Changeset: 565b21a8c68e418dcdb551c867b0b44286b493a0

comment:15 Changed 6 years ago by Nick Draper

  • Status changed from inprogress to verify
  • Resolution set to fixed

comment:16 Changed 6 years ago by Peter Parker

  • Status changed from verify to verifying

comment:17 Changed 6 years ago by Peter Parker

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/feature/9796_hide_sort_for_table_workspace'

Full changeset: f071413570042a5c6f0c75283d59b2fa8a62740c

comment:18 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 10638

Note: See TracTickets for help on using tickets.