Changeset c4c4957 in sasview for src/sas/qtgui/Utilities


Ignore:
Timestamp:
Nov 20, 2018 4: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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.