Changeset ee22241 in sasview


Ignore:
Timestamp:
Sep 24, 2018 9:15:49 AM (4 weeks ago)
Author:
rozyczko <piotr.rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_image_viewer, ESS_GUI_project_save
Children:
2dce1d8
Parents:
712db9e
Message:

Refactored onHelp a bit to allow more encapsulation. SASVIEW-1112

Location:
src/sas/qtgui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/MainWindow/GuiManager.py

    rdad086f ree22241  
    202202        Open a local url in the default browser 
    203203        """ 
    204         location = GuiUtils.HELP_DIRECTORY_LOCATION + url 
    205         #WP: Added to handle OSX bundle docs 
    206         if os.path.isdir(location) == False: 
    207             sas_path = os.path.abspath(os.path.dirname(sys.argv[0])) 
    208             location = sas_path+"/"+location 
    209         try: 
    210             webbrowser.open('file://' + os.path.realpath(location)) 
    211         except webbrowser.Error as ex: 
    212             logging.warning("Cannot display help. %s" % ex) 
     204        GuiUtils.showHelp(url) 
    213205 
    214206    def workspace(self): 
  • src/sas/qtgui/Plotting/SlicerParameters.py

    raed0532 ree22241  
    44import numpy 
    55import functools 
     6 
    67from PyQt5 import QtCore 
    78from PyQt5 import QtGui 
     
    8687        Display generic data averaging help 
    8788        """ 
    88         location = "/user/qtgui/MainWindow/graph_help.html#d-data-averaging" 
    89         self.parent.showHelp(location) 
    90  
     89        url = "/user/qtgui/MainWindow/graph_help.html#d-data-averaging" 
     90        GuiUtils.showHelp(url) 
    9191 
    9292class ProxyModel(QtCore.QIdentityProxyModel): 
  • src/sas/qtgui/Utilities/GuiUtils.py

    r9ce69ec ree22241  
    584584        msg = "Attempt at opening an invalid URL" 
    585585        raise AttributeError(msg) 
     586 
     587def showHelp(url): 
     588    """ 
     589    Open a local url in the default browser 
     590    """ 
     591    location = HELP_DIRECTORY_LOCATION + url 
     592    #WP: Added to handle OSX bundle docs 
     593    if os.path.isdir(location) == False: 
     594        sas_path = os.path.abspath(os.path.dirname(sys.argv[0])) 
     595        location = sas_path+"/"+location 
     596    try: 
     597        webbrowser.open('file://' + os.path.realpath(location)) 
     598    except webbrowser.Error as ex: 
     599        logging.warning("Cannot display help. %s" % ex) 
    586600 
    587601def retrieveData1d(data): 
Note: See TracChangeset for help on using the changeset viewer.