Changeset b9e89d5 in sasview


Ignore:
Timestamp:
Apr 16, 2018 10:05:41 AM (7 years ago)
Author:
krzywon
Branches:
ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
318b353e
Parents:
76567bb
Message:

Use communicator to delete data from Inversion perspective when deleted from data display.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Inversion/InversionPerspective.py

    r76567bb rb9e89d5  
    1919# Batch calculation display 
    2020from sas.qtgui.Utilities.GridPanel import BatchInversionOutputPanel 
     21 
    2122 
    2223def is_float(value): 
     
    2728        return 0.0 
    2829 
     30 
    2931NUMBER_OF_TERMS = 10 
    3032REGULARIZATION = 0.0001 
     
    3436 
    3537 
    36 # TODO: Use communicator to catch data deletions 
    3738# TODO: Update help with batch capabilities 
    3839class InversionWindow(QtWidgets.QDialog, Ui_PrInversion): 
     
    5354 
    5455        self._manager = parent 
    55         self.communicate = GuiUtils.Communicate() 
     56        self.communicate = parent.communicator() 
     57        self.communicate.dataDeletedSignal.connect(self.removeData) 
    5658 
    5759        self.logic = InversionLogic() 
     
    500502        self.enableButtons() 
    501503 
    502     def removeData(self): 
     504    def removeData(self, data_list=None): 
    503505        """Remove the existing data reference from the P(r) Persepective""" 
    504506        if self.dmaxWindow is not None: 
    505507            self.dmaxWindow.close() 
    506508            self.dmaxWindow = None 
    507         self._data_list.pop(self._data) 
     509        if not data_list: 
     510            data_list = [self._data] 
     511        for data in data_list: 
     512            self._data_list.pop(data) 
    508513        self._data = None 
    509         self.dataList.removeItem(self.dataList.currentIndex()) 
     514        for index in range(0, len(self.dataList)): 
     515            if self.dataList.itemData(index) in data_list: 
     516                self.dataList.removeItem(index) 
    510517        # Last file removed 
    511518        if len(self._data_list) == 0: 
Note: See TracChangeset for help on using the changeset viewer.