Changeset 11375:1b176d077918 in orange


Ignore:
Timestamp:
02/26/13 16:15:35 (14 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Children:
11376:21416f0f773b, 11381:e7185f522cc8
Message:

Fix to 'open in external browser' help requests.

Try fixing some common problems with url formating when opening help pages,
e.g. no 'file' scheme for local files, fragments in local paths, etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeCanvas/application/canvasmain.py

    r11350 r11375  
    15481548        log.info("Setting help to url: %r", url) 
    15491549        if self.open_in_external_browser: 
    1550             QDesktopServices.openUrl(QUrl(url)) 
     1550            url = QUrl(url) 
     1551            if not QDesktopServices.openUrl(url): 
     1552                # Try fixing some common problems. 
     1553                url = QUrl.fromUserInput(url.toString()) 
     1554                # 'fromUserInput' includes possible fragment into the path 
     1555                # (which prevents it to open local files) so we reparse it 
     1556                # again. 
     1557                url = QUrl(url.toString()) 
     1558                QDesktopServices.openUrl(url) 
    15511559        else: 
    15521560            self.help_view.load(QUrl(url)) 
Note: See TracChangeset for help on using the changeset viewer.