Changeset c4c4957 in sasview


Ignore:
Timestamp:
Nov 20, 2018 2:06:25 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:
be7c981
Parents:
8c85ac1
Message:

Batch results tabs now have meaningful names SASVIEW-1204

Location:
src/sas/qtgui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/ConstraintWidget.py

    raed0532 rc4c4957  
    11import logging 
     2import copy 
    23 
    34from twisted.internet import threads 
     
    364365 
    365366        # Show the grid panel 
    366         self.parent.communicate.sendDataToGridSignal.emit(result[0]) 
     367        page_name = "ConstSimulPage" 
     368        results = copy.deepcopy(result[0]) 
     369        results.append(page_name) 
     370        self.parent.communicate.sendDataToGridSignal.emit(results) 
    367371 
    368372        msg = "Fitting completed successfully in: %s s.\n" % GuiUtils.formatNumber(elapsed) 
  • src/sas/qtgui/Perspectives/Fitting/FittingWidget.py

    ra2b8607 rc4c4957  
    14931493 
    14941494        # Show the grid panel 
    1495         self.communicate.sendDataToGridSignal.emit(result[0]) 
     1495        page_name = "BatchPage" + str(self.tab_id) 
     1496        results = copy.deepcopy(result[0]) 
     1497        results.append(page_name) 
     1498        self.communicate.sendDataToGridSignal.emit(results) 
    14961499 
    14971500        elapsed = result[1] 
  • src/sas/qtgui/Utilities/GridPanel.py

    r75906a1 rc4c4957  
    126126        return 
    127127 
    128     def addTabPage(self): 
     128    def addTabPage(self, name=None): 
    129129        """ 
    130130        Add new tab page with QTableWidget 
     
    141141        # However, some models have LONG names, which doesn't look well on the tab bar. 
    142142        self.tab_number += 1 
    143         tab_name = "Tab " + str(self.tab_number) 
     143        if name is not None: 
     144            tab_name = name 
     145        else: 
     146            tab_name = "Tab " + str(self.tab_number) 
    144147        # each table needs separate slots. 
    145148        tab_widget.customContextMenuRequested.connect(self.showContextMenu) 
     
    153156        Create a new tab with batch fitting results 
    154157        """ 
     158        # pull out page name from results 
     159        page_name = None 
     160        if len(results)>=2: 
     161            if isinstance(results[-1], str): 
     162                page_name = results[-1] 
     163                _ = results.pop(-1) 
     164 
    155165        if self.has_data: 
    156             self.addTabPage() 
     166            self.addTabPage(name=page_name) 
     167        else: 
     168            self.tabWidget.setTabText(0, page_name) 
    157169        # Update the new widget 
    158170        # Fill in the table from input data in the last/newest page 
Note: See TracChangeset for help on using the changeset viewer.