Ignore:
Timestamp:
Feb 21, 2017 1:40:52 PM (7 years ago)
Author:
krzywon
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
ef2cdb3, 7a5aedd
Parents:
11b094f
Message:

Save states with 'Customized Models' category now load as 'Plugin Models' and created constants for both strings.

File:
1 edited

Legend:

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

    r11b094f r4387385  
    5252    FONT_VARIANT = 1 
    5353    ON_MAC = True 
     54 
     55CUSTOM_MODEL = 'Plugin Models' 
     56CUSTOM_MODEL_OLD = 'Customized Models' 
    5457 
    5558class BasicPage(ScrolledPanel, PanelBase): 
     
    11561159        # select the current model 
    11571160        state._convert_to_sasmodels() 
     1161        if state.categorycombobox == CUSTOM_MODEL_OLD: 
     1162            state.categorycombobox = CUSTOM_MODEL 
    11581163        state.categorycombobox = unicode(state.categorycombobox) 
    11591164        if state.categorycombobox in self.categorybox.Items: 
     
    11671172        self._show_combox(None) 
    11681173        from models import PLUGIN_NAME_BASE 
    1169         if self.categorybox.GetValue() == 'Customized Models' \ 
     1174        if self.categorybox.GetValue() == CUSTOM_MODEL \ 
    11701175                and PLUGIN_NAME_BASE not in state.formfactorcombobox: 
    11711176            state.formfactorcombobox = \ 
     
    17981803        Fill panel's combo box according to the type of model selected 
    17991804        """ 
    1800         custom_model = 'Plugin Models' 
     1805 
    18011806        mod_cat = self.categorybox.GetStringSelection() 
    18021807        self.structurebox.SetSelection(0) 
     
    18071812        m_list = [] 
    18081813        try: 
    1809             if mod_cat == custom_model: 
     1814            if mod_cat == CUSTOM_MODEL: 
    18101815                for model in self.model_list_box[mod_cat]: 
    18111816                    m_list.append(self.model_dict[model.name]) 
Note: See TracChangeset for help on using the changeset viewer.