Changeset ca30e36b in sasview


Ignore:
Timestamp:
Sep 28, 2018 2:31:33 PM (6 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, unittest-saveload
Children:
ba1c145
Parents:
93c505b
Message:

make sure the current page is shown after all pages are updated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/fitting.py

    r93c505b rca30e36b  
    339339        Update custom model list in the fitpage combo box 
    340340        """ 
    341         custom_model = 'Plugin Models' 
    342341        try: 
    343342            # Update edit menus 
     
    347346            if not new_pmodel_list: 
    348347                return 
     348 
     349            # Redraws to a page not in focus are showing up as if they are 
     350            # in the current page tab. 
     351            current_page_index = self.fit_panel.GetSelection() 
     352            current_page = self.fit_panel.GetCurrentPage() 
     353            last_drawn_page = current_page 
     354 
    349355            # Set the new plugin model list for all fit pages; anticipating 
    350356            # categories, the updated plugin may be in either the form factor 
     
    400406                    #print("triggering model update") 
    401407                    page._on_select_model(keep_pars=True) 
     408                    last_drawn_page = page 
     409 
     410            # If last drawn is not the current, then switch the current to the 
     411            # last drawn then switch back.  Very ugly. 
     412            if last_drawn_page != current_page: 
     413                for page_index in range(self.fit_panel.PageCount): 
     414                    if self.fit_panel.GetPage(page_index) == last_drawn_page: 
     415                        self.fit_panel.SetSelection(page_index) 
     416                        break 
     417                self.fit_panel.SetSelection(current_page_index) 
     418 
    402419        except Exception: 
    403420            logger.error("update_custom_combo: %s", sys.exc_value) 
Note: See TracChangeset for help on using the changeset viewer.