Changeset 5d75a181 in sasview for src


Ignore:
Timestamp:
Nov 29, 2018 9:19:45 AM (6 years ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_sync_sascalc
Children:
d9e7792
Parents:
376a939
Message:

Various fixes to project read/save for theories and frozen theories

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/MainWindow/DataExplorer.py

    r376a939 r5d75a181  
    44import time 
    55import logging 
     6import copy 
    67 
    78from PyQt5 import QtCore 
     
    240241        # check if any items loaded and warn about data deletion 
    241242        if self.model.rowCount() > 0: 
    242             msg = "This operation will set remove all data, plots and analyses from" 
     243            msg = "This operation will remove all data, plots and analyses from" 
    243244            msg += " SasView before loading the project. Do you wish to continue?" 
    244245            msgbox = QtWidgets.QMessageBox(self) 
     
    539540            # add the main index 
    540541            if not value: continue 
    541             #if key=='is_batch': 
    542             #    self.chkBatch.setChecked(True if value=='True' else False) 
    543             #    continue 
    544542            new_data = value[0] 
    545543            from sas.sascalc.dataloader.data_info import Data1D as old_data1d 
     
    557555            items.append(new_item) 
    558556            model = self.theory_model 
    559             if new_data.is_data: 
     557            if value[0].is_data: 
    560558                model = self.model 
    561559                # Caption for the theories 
     
    797795        info_item = QtGui.QStandardItem("Info") 
    798796        data_item = QtGui.QStandardItem() 
    799         data_item.setData(item_from.child(0).data()) 
     797        orig_data = copy.deepcopy(item_from.child(0).data()) 
     798        data_item.setData(orig_data) 
    800799        new_item.setText(item_from.text()) 
    801800        new_item.setChild(0, data_item) 
     
    809808            new_item.child(0).data().is_data = True 
    810809            new_item.child(0).data().symbol = 'Circle' 
     810            new_item.child(0).data().id = new_name 
    811811        except AttributeError: 
    812812            #no data here, pass 
     
    15301530            data.is_data = True 
    15311531            data.symbol = 'Circle' 
     1532            data.id = new_name 
    15321533        except AttributeError: 
    15331534            #no data here, pass 
     
    15591560        deleted_items = [self.model.item(row) for row in range(self.model.rowCount()) 
    15601561                         if self.model.item(row).isCheckable()] 
     1562        deleted_theory_items = [self.theory_model.item(row) 
     1563                                for row in range(self.theory_model.rowCount()) 
     1564                                if self.theory_model.item(row).isCheckable()] 
     1565        deleted_items += deleted_theory_items 
    15611566        deleted_names = [item.text() for item in deleted_items] 
     1567        deleted_names += deleted_theory_items 
    15621568        # Let others know we deleted data 
    15631569        self.communicator.dataDeletedSignal.emit(deleted_items) 
     
    15671573        # Clear the model 
    15681574        self.model.clear() 
     1575        self.theory_model.clear() 
    15691576 
    15701577    def deleteSelectedItem(self): 
Note: See TracChangeset for help on using the changeset viewer.