Helpviewer/HelpWindow.py

changeset 258
9402d145020d
parent 256
04083f42042d
child 313
4872737993ab
equal deleted inserted replaced
257:e03694226603 258:9402d145020d
1422 1422
1423 @param path path string to guess an URL for (string) 1423 @param path path string to guess an URL for (string)
1424 @return guessed URL (QUrl) 1424 @return guessed URL (QUrl)
1425 """ 1425 """
1426 manager = self.searchEdit.openSearchManager() 1426 manager = self.searchEdit.openSearchManager()
1427 path = Utilities.fromNativeSeparators(path)
1427 url = manager.convertKeywordSearchToUrl(path) 1428 url = manager.convertKeywordSearchToUrl(path)
1428 if url.isValid(): 1429 if url.isValid():
1429 return url 1430 return url
1430 1431
1431 return QUrl(path) 1432 return QUrl(path)
1543 "PDF Files (*.pdf);;" 1544 "PDF Files (*.pdf);;"
1544 "CHM Files (*.chm);;" 1545 "CHM Files (*.chm);;"
1545 "All Files (*)" 1546 "All Files (*)"
1546 )) 1547 ))
1547 if fn: 1548 if fn:
1548 self.currentBrowser().setSource(QUrl("file://" + fn)) 1549 if Utilities.isWindowsPlatform():
1550 url = "file:///" + Utilities.fromNativeSeparators(fn)
1551 else:
1552 url = "file://" + fn
1553 self.currentBrowser().setSource(QUrl(url))
1549 1554
1550 def __openFileNewTab(self): 1555 def __openFileNewTab(self):
1551 """ 1556 """
1552 Private slot called to open a file in a new tab. 1557 Private slot called to open a file in a new tab.
1553 """ 1558 """
1559 "PDF Files (*.pdf);;" 1564 "PDF Files (*.pdf);;"
1560 "CHM Files (*.chm);;" 1565 "CHM Files (*.chm);;"
1561 "All Files (*)" 1566 "All Files (*)"
1562 )) 1567 ))
1563 if fn: 1568 if fn:
1564 self.newTab("file://" + fn) 1569 if Utilities.isWindowsPlatform():
1570 url = "file:///" + Utilities.fromNativeSeparators(fn)
1571 else:
1572 url = "file://" + fn
1573 self.newTab(url)
1565 1574
1566 def __savePageAs(self): 1575 def __savePageAs(self):
1567 """ 1576 """
1568 Private slot to save the current page. 1577 Private slot to save the current page.
1569 """ 1578 """

eric ide

mercurial