Changeset 044454d in sasview


Ignore:
Timestamp:
Apr 19, 2018 2:35:46 PM (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:
0662f53
Parents:
917eba5
Message:

Fix issues deleting from p(r) when data deleted in data manager.

File:
1 edited

Legend:

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

    r917eba5 r044454d  
    8686            for datum in data_list: 
    8787                self.updateDataList(datum) 
     88 
     89        self.dataDeleted = False 
    8890 
    8991        self.enableButtons() 
     
    318320    def displayChange(self, data_index=0): 
    319321        """Switch to another item in the data list""" 
     322        if self.dataDeleted: 
     323            return 
    320324        self.updateDataList(self._data) 
    321325        self.setCurrentData(self.dataList.itemData(data_index)) 
     
    512516            title = self.dataPlot.name 
    513517            GuiUtils.updateModelItemWithPlot(self._data, self.dataPlot, title) 
    514             self.communicate.plotRequestedSignal.emit( 
    515                 [self.dataPlot, self.logic.data]) 
     518            self.communicate.plotRequestedSignal.emit([self.dataPlot]) 
    516519        self.enableButtons() 
    517520 
    518521    def removeData(self, data_list=None): 
    519522        """Remove the existing data reference from the P(r) Persepective""" 
     523        self.dataDeleted = True 
    520524        if not data_list: 
    521525            data_list = [self._data] 
     
    523527        for data in data_list: 
    524528            self._dataList.pop(data) 
    525             data_file = GuiUtils.dataFromItem(data) 
    526             self.batchResults.pop(data_file.filename) 
    527529        self._data = None 
    528         for index in range(0, len(self.dataList)): 
     530        length = len(self.dataList) 
     531        for index in reversed(range(length)): 
    529532            if self.dataList.itemData(index) in data_list: 
    530533                self.dataList.removeItem(index) 
    531534        # Last file removed 
     535        self.dataDeleted = False 
    532536        if len(self._dataList) == 0: 
    533537            self.prPlot = None 
Note: See TracChangeset for help on using the changeset viewer.