Changeset 3c8242c in sasview for src/sas/qtgui/Utilities/GuiUtils.py


Ignore:
Timestamp:
Sep 13, 2017 7:39:49 AM (7 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
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
Children:
a14a2b0
Parents:
fef38e8
Message:

Partially revert last commit. Went too far.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Utilities/GuiUtils.py

    rfef38e8 r3c8242c  
    9494    return config_module 
    9595 
    96 def _init(): 
    97     # Get APP folder 
    98     PATH_APP = get_app_dir() 
    99     DATAPATH = PATH_APP 
    100  
    101     # Read in the local config, which can either be with the main 
    102     # application or in the installation directory 
    103     config = _find_local_config('local_config', PATH_APP) 
    104  
    105     if config is None: 
    106         config = _find_local_config('local_config', os.getcwd()) 
     96 
     97# Get APP folder 
     98PATH_APP = get_app_dir() 
     99DATAPATH = PATH_APP 
     100 
     101# Read in the local config, which can either be with the main 
     102# application or in the installation directory 
     103config = _find_local_config('local_config', PATH_APP) 
     104 
     105if config is None: 
     106    config = _find_local_config('local_config', os.getcwd()) 
     107else: 
     108    pass 
     109 
     110c_conf_dir = CustomDir.setup_conf_dir(PATH_APP) 
     111 
     112custom_config = _find_local_config('custom_config', c_conf_dir) 
     113if custom_config is None: 
     114    custom_config = _find_local_config('custom_config', os.getcwd()) 
     115    if custom_config is None: 
     116        msgConfig = "Custom_config file was not imported" 
     117 
     118#read some constants from config 
     119APPLICATION_STATE_EXTENSION = config.APPLICATION_STATE_EXTENSION 
     120APPLICATION_NAME = config.__appname__ 
     121SPLASH_SCREEN_PATH = config.SPLASH_SCREEN_PATH 
     122WELCOME_PANEL_ON = config.WELCOME_PANEL_ON 
     123SPLASH_SCREEN_WIDTH = config.SPLASH_SCREEN_WIDTH 
     124SPLASH_SCREEN_HEIGHT = config.SPLASH_SCREEN_HEIGHT 
     125SS_MAX_DISPLAY_TIME = config.SS_MAX_DISPLAY_TIME 
     126if not WELCOME_PANEL_ON: 
     127    WELCOME_PANEL_SHOW = False 
     128else: 
     129    WELCOME_PANEL_SHOW = True 
     130try: 
     131    DATALOADER_SHOW = custom_config.DATALOADER_SHOW 
     132    TOOLBAR_SHOW = custom_config.TOOLBAR_SHOW 
     133    FIXED_PANEL = custom_config.FIXED_PANEL 
     134    if WELCOME_PANEL_ON: 
     135        WELCOME_PANEL_SHOW = custom_config.WELCOME_PANEL_SHOW 
     136    PLOPANEL_WIDTH = custom_config.PLOPANEL_WIDTH 
     137    DATAPANEL_WIDTH = custom_config.DATAPANEL_WIDTH 
     138    GUIFRAME_WIDTH = custom_config.GUIFRAME_WIDTH 
     139    GUIFRAME_HEIGHT = custom_config.GUIFRAME_HEIGHT 
     140    CONTROL_WIDTH = custom_config.CONTROL_WIDTH 
     141    CONTROL_HEIGHT = custom_config.CONTROL_HEIGHT 
     142    DEFAULT_PERSPECTIVE = custom_config.DEFAULT_PERSPECTIVE 
     143    CLEANUP_PLOT = custom_config.CLEANUP_PLOT 
     144    # custom open_path 
     145    open_folder = custom_config.DEFAULT_OPEN_FOLDER 
     146    if open_folder != None and os.path.isdir(open_folder): 
     147        DEFAULT_OPEN_FOLDER = os.path.abspath(open_folder) 
    107148    else: 
    108         pass 
    109  
    110     c_conf_dir = CustomDir.setup_conf_dir(PATH_APP) 
    111  
    112     custom_config = _find_local_config('custom_config', c_conf_dir) 
    113     if custom_config is None: 
    114         custom_config = _find_local_config('custom_config', os.getcwd()) 
    115         if custom_config is None: 
    116             msgConfig = "Custom_config file was not imported" 
    117  
    118     #read some constants from config 
    119     APPLICATION_STATE_EXTENSION = config.APPLICATION_STATE_EXTENSION 
    120     APPLICATION_NAME = config.__appname__ 
    121     SPLASH_SCREEN_PATH = config.SPLASH_SCREEN_PATH 
    122     WELCOME_PANEL_ON = config.WELCOME_PANEL_ON 
    123     SPLASH_SCREEN_WIDTH = config.SPLASH_SCREEN_WIDTH 
    124     SPLASH_SCREEN_HEIGHT = config.SPLASH_SCREEN_HEIGHT 
    125     SS_MAX_DISPLAY_TIME = config.SS_MAX_DISPLAY_TIME 
    126     if not WELCOME_PANEL_ON: 
    127         WELCOME_PANEL_SHOW = False 
    128     else: 
    129         WELCOME_PANEL_SHOW = True 
    130     try: 
    131         DATALOADER_SHOW = custom_config.DATALOADER_SHOW 
    132         TOOLBAR_SHOW = custom_config.TOOLBAR_SHOW 
    133         FIXED_PANEL = custom_config.FIXED_PANEL 
    134         if WELCOME_PANEL_ON: 
    135             WELCOME_PANEL_SHOW = custom_config.WELCOME_PANEL_SHOW 
    136         PLOPANEL_WIDTH = custom_config.PLOPANEL_WIDTH 
    137         DATAPANEL_WIDTH = custom_config.DATAPANEL_WIDTH 
    138         GUIFRAME_WIDTH = custom_config.GUIFRAME_WIDTH 
    139         GUIFRAME_HEIGHT = custom_config.GUIFRAME_HEIGHT 
    140         CONTROL_WIDTH = custom_config.CONTROL_WIDTH 
    141         CONTROL_HEIGHT = custom_config.CONTROL_HEIGHT 
    142         DEFAULT_PERSPECTIVE = custom_config.DEFAULT_PERSPECTIVE 
    143         CLEANUP_PLOT = custom_config.CLEANUP_PLOT 
    144         # custom open_path 
    145         open_folder = custom_config.DEFAULT_OPEN_FOLDER 
    146         if open_folder != None and os.path.isdir(open_folder): 
    147             DEFAULT_OPEN_FOLDER = os.path.abspath(open_folder) 
    148         else: 
    149             DEFAULT_OPEN_FOLDER = PATH_APP 
    150     except AttributeError: 
    151         DATALOADER_SHOW = True 
    152         TOOLBAR_SHOW = True 
    153         FIXED_PANEL = True 
    154         WELCOME_PANEL_SHOW = False 
    155         PLOPANEL_WIDTH = config.PLOPANEL_WIDTH 
    156         DATAPANEL_WIDTH = config.DATAPANEL_WIDTH 
    157         GUIFRAME_WIDTH = config.GUIFRAME_WIDTH 
    158         GUIFRAME_HEIGHT = config.GUIFRAME_HEIGHT 
    159         CONTROL_WIDTH = -1 
    160         CONTROL_HEIGHT = -1 
    161         DEFAULT_PERSPECTIVE = None 
    162         CLEANUP_PLOT = False 
    163149        DEFAULT_OPEN_FOLDER = PATH_APP 
    164  
    165     #DEFAULT_STYLE = config.DEFAULT_STYLE 
    166  
    167     PLUGIN_STATE_EXTENSIONS = config.PLUGIN_STATE_EXTENSIONS 
    168     OPEN_SAVE_MENU = config.OPEN_SAVE_PROJECT_MENU 
    169     VIEW_MENU = config.VIEW_MENU 
    170     EDIT_MENU = config.EDIT_MENU 
    171     extension_list = [] 
    172     if APPLICATION_STATE_EXTENSION is not None: 
    173         extension_list.append(APPLICATION_STATE_EXTENSION) 
    174     EXTENSIONS = PLUGIN_STATE_EXTENSIONS + extension_list 
    175     try: 
    176         PLUGINS_WLIST = '|'.join(config.PLUGINS_WLIST) 
    177     except AttributeError: 
    178         PLUGINS_WLIST = '' 
    179     APPLICATION_WLIST = config.APPLICATION_WLIST 
    180     IS_WIN = True 
    181     IS_LINUX = False 
    182     CLOSE_SHOW = True 
    183     TIME_FACTOR = 2 
    184     NOT_SO_GRAPH_LIST = ["BoxSum"] 
     150except AttributeError: 
     151    DATALOADER_SHOW = True 
     152    TOOLBAR_SHOW = True 
     153    FIXED_PANEL = True 
     154    WELCOME_PANEL_SHOW = False 
     155    PLOPANEL_WIDTH = config.PLOPANEL_WIDTH 
     156    DATAPANEL_WIDTH = config.DATAPANEL_WIDTH 
     157    GUIFRAME_WIDTH = config.GUIFRAME_WIDTH 
     158    GUIFRAME_HEIGHT = config.GUIFRAME_HEIGHT 
     159    CONTROL_WIDTH = -1 
     160    CONTROL_HEIGHT = -1 
     161    DEFAULT_PERSPECTIVE = None 
     162    CLEANUP_PLOT = False 
     163    DEFAULT_OPEN_FOLDER = PATH_APP 
     164 
     165#DEFAULT_STYLE = config.DEFAULT_STYLE 
     166 
     167PLUGIN_STATE_EXTENSIONS = config.PLUGIN_STATE_EXTENSIONS 
     168OPEN_SAVE_MENU = config.OPEN_SAVE_PROJECT_MENU 
     169VIEW_MENU = config.VIEW_MENU 
     170EDIT_MENU = config.EDIT_MENU 
     171extension_list = [] 
     172if APPLICATION_STATE_EXTENSION is not None: 
     173    extension_list.append(APPLICATION_STATE_EXTENSION) 
     174EXTENSIONS = PLUGIN_STATE_EXTENSIONS + extension_list 
     175try: 
     176    PLUGINS_WLIST = '|'.join(config.PLUGINS_WLIST) 
     177except AttributeError: 
     178    PLUGINS_WLIST = '' 
     179APPLICATION_WLIST = config.APPLICATION_WLIST 
     180IS_WIN = True 
     181IS_LINUX = False 
     182CLOSE_SHOW = True 
     183TIME_FACTOR = 2 
     184NOT_SO_GRAPH_LIST = ["BoxSum"] 
     185 
    185186 
    186187class Communicate(QtCore.QObject): 
Note: See TracChangeset for help on using the changeset viewer.