Changeset 63467b6 in sasview for src/sas/qtgui/MainWindow


Ignore:
Timestamp:
Sep 27, 2018 2:20:24 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_ordering, ESS_GUI_sync_sascalc
Children:
4f8c17f
Parents:
dce68f6
Message:

Improved handling of 2d plot children. Refactored model tree search.

Location:
src/sas/qtgui/MainWindow
Files:
2 edited

Legend:

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

    r428c3b2 r63467b6  
    950950 
    951951        types = (None, Data1D, Data2D) 
    952         assert dimension in types 
     952        if not dimension in types: 
     953            return 
    953954 
    954955        for index in range(model.rowCount()): 
    955956            item = model.item(index) 
    956             if dimension is not None and not isinstance(GuiUtils.dataFromItem(item), dimension): 
    957                 continue 
    958957            if item.isCheckable() and item.checkState() != mode: 
    959                 item.setCheckState(mode) 
    960             # look for all children 
    961             for inner_index in range(item.rowCount()): 
    962                 child = item.child(inner_index) 
    963                 if child.isCheckable() and child.checkState() != mode: 
    964                     child.setCheckState(mode) 
     958                data = item.child(0).data() 
     959                if dimension is None or isinstance(data, dimension): 
     960                    item.setCheckState(mode) 
     961 
     962            items = list(GuiUtils.getChildrenFromItem(item)) 
     963 
     964            for it in items: 
     965                if it.isCheckable() and it.checkState() != mode: 
     966                    data = it.child(0).data() 
     967                    if dimension is None or isinstance(data, dimension): 
     968                        it.setCheckState(mode) 
    965969 
    966970    def selectData(self, index): 
     
    14141418        current_tab_name = model_item.text() 
    14151419        for current_index in range(self.theory_model.rowCount()): 
    1416             #if current_tab_name in self.theory_model.item(current_index).text(): 
    14171420            if current_tab_name == self.theory_model.item(current_index).text(): 
    14181421                self.theory_model.removeRow(current_index) 
    14191422                break 
    1420  
    14211423        # send in the new item 
    14221424        self.theory_model.appendRow(model_item) 
  • src/sas/qtgui/MainWindow/UnitTesting/MainWindowTest.py

    rfa762f4 r63467b6  
    5454        tmp_main.guiManager.showWelcomeMessage() 
    5555        # Assure it is visible and a part of the MdiArea 
    56         self.assertTrue(tmp_main.guiManager.welcomePanel.isVisible()) 
    5756        self.assertEqual(len(tmp_main.workspace.subWindowList()), 2) 
    5857 
Note: See TracChangeset for help on using the changeset viewer.