Changeset a54bbf2b in sasview for src/sas/qtgui/Utilities


Ignore:
Timestamp:
Sep 11, 2018 10:00:45 AM (6 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
2d47985
Parents:
343d7fd
Message:

Added plot roles to Data1D/Data2D structures to allow for smoother plot logic.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Utilities/GuiUtils.py

    r5d28d6b ra54bbf2b  
    322322    assert isinstance(item, QtGui.QStandardItem) 
    323323 
     324    # lists of plots names/ids for all deletable plots on item 
    324325    names = [p.name for p in new_plots if p.name is not None] 
    325326    ids = [p.id for p in new_plots if p.id is not None] 
     
    329330    for index in range(item.rowCount()): 
    330331        plot_item = item.child(index) 
    331         if plot_item.isCheckable(): 
    332             plot_data = plot_item.child(0).data() 
    333             if (plot_data.id is not None) and (plot_data.id not in ids) and (plot_data.name not in names): 
    334                 items_to_delete.append(plot_item) 
     332        if not plot_item.isCheckable(): 
     333            continue 
     334        plot_data = plot_item.child(0).data() 
     335        if (plot_data.id is not None) and \ 
     336            (plot_data.id not in ids) and \ 
     337            (plot_data.name not in names) and \ 
     338            (plot_data.plot_role == Data1D.ROLE_DELETABLE): 
     339            items_to_delete.append(plot_item) 
    335340 
    336341    for plot_item in items_to_delete: 
Note: See TracChangeset for help on using the changeset viewer.