Ignore:
Timestamp:
Dec 14, 2017 7:51:02 AM (6 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:
7fd20fc, 626c7c5
Parents:
8353d90
Message:

Show help pages in default browser. Fixed some help links and modified unit tests. SASVIEW-800

File:
1 edited

Legend:

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

    r8353d90 re90988c  
    8787        self.statusBarSetup() 
    8888 
    89         # Current help file 
    90         self._helpView = QWebView() 
    9189        # Needs URL like path, so no path.join() here 
    9290        self._helpLocation = GuiUtils.HELP_DIRECTORY_LOCATION + "/index.html" 
     
    164162        """ 
    165163        pass 
     164 
     165    def showHelp(self, url): 
     166        """ 
     167        Open a local url in the default browser 
     168        """ 
     169        location = GuiUtils.HELP_DIRECTORY_LOCATION + url 
     170        try: 
     171            webbrowser.open('file://' + os.path.realpath(location)) 
     172        except webbrowser.Error as ex: 
     173            logging.warning("Cannot display help. %s" % ex) 
    166174 
    167175    def workspace(self): 
     
    718726        TODO: use QNetworkAccessManager to assure _helpLocation is valid 
    719727        """ 
    720         self._helpView.load(QUrl(self._helpLocation)) 
    721         self._helpView.show() 
     728        self.showHelp(self._helpLocation) 
    722729 
    723730    def actionTutorial(self): 
Note: See TracChangeset for help on using the changeset viewer.