Changeset 9c05f22 in sasview for src/sas/qtgui


Ignore:
Timestamp:
Nov 23, 2018 9:37:05 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:
2e5081b, 531dd64
Parents:
9817207
Message:

Allow model-specific help be shown when a model is defined.

File:
1 edited

Legend:

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

    r9817207 r9c05f22  
    11import json 
    22import os 
     3import sys 
    34from collections import defaultdict 
    45 
     
    14611462        helpfile = "fitting.html" 
    14621463        if tab_id == 0: 
    1463             helpfile = "fitting_help.html" 
     1464            # Look at the model and if set, pull out its help page 
     1465            if self.kernel_module is not None and hasattr(self.kernel_module, 'name'): 
     1466                # See if the help file is there 
     1467                # This breaks encapsulation a bit, though. 
     1468                full_path = GuiUtils.HELP_DIRECTORY_LOCATION 
     1469                sas_path = os.path.abspath(os.path.dirname(sys.argv[0])) 
     1470                location = sas_path + "/" + full_path 
     1471                location += "/user/models/" + self.kernel_module.id + ".html" 
     1472                if os.path.isfile(location): 
     1473                    # We have HTML for this model - show it 
     1474                    tree_location = "/user/models/" 
     1475                    helpfile = self.kernel_module.id + ".html" 
     1476            else: 
     1477                helpfile = "fitting_help.html" 
    14641478        elif tab_id == 1: 
    14651479            helpfile = "residuals_help.html" 
Note: See TracChangeset for help on using the changeset viewer.