Helpviewer/HelpWindow.py

changeset 256
04083f42042d
parent 142
94ce651735db
child 258
9402d145020d
equal deleted inserted replaced
255:eb0ffc3f12a2 256:04083f42042d
1289 self.pathCombo.setInsertPolicy(QComboBox.InsertAtTop) 1289 self.pathCombo.setInsertPolicy(QComboBox.InsertAtTop)
1290 self.pathCombo.setEditable(1) 1290 self.pathCombo.setEditable(1)
1291 self.pathCombo.setAutoCompletion(True) 1291 self.pathCombo.setAutoCompletion(True)
1292 self.connect(self.pathCombo, SIGNAL('activated(const QString&)'), 1292 self.connect(self.pathCombo, SIGNAL('activated(const QString&)'),
1293 self.__pathSelected) 1293 self.__pathSelected)
1294 self.connect(self.pathCombo.lineEdit(), SIGNAL('returnPressed()'),
1295 self.__pathEdited)
1296 self.pathCombo.setWhatsThis(self.trUtf8( 1294 self.pathCombo.setWhatsThis(self.trUtf8(
1297 """<p>Enter the help file to be displayed directly into this""" 1295 """<p>Enter the help file to be displayed directly into this"""
1298 """ edit field. Select a previously shown help file from the""" 1296 """ edit field. Select a previously shown help file from the"""
1299 """ drop down list.</p>""" 1297 """ drop down list.</p>"""
1300 )) 1298 ))
1405 act = self.historyMenu.addAction( 1403 act = self.historyMenu.addAction(
1406 Utilities.compactPath(hist, self.maxMenuFilePathLen)) 1404 Utilities.compactPath(hist, self.maxMenuFilePathLen))
1407 act.setData(idx) 1405 act.setData(idx)
1408 idx += 1 1406 idx += 1
1409 act.setIcon(HelpWindow.__getWebIcon(QUrl(hist))) 1407 act.setIcon(HelpWindow.__getWebIcon(QUrl(hist)))
1410
1411 def __pathEdited(self):
1412 """
1413 Private slot called, when a URL has been entered.
1414 """
1415 path = self.pathCombo.currentText()
1416 self.__pathSelected(path)
1417 1408
1418 def __pathSelected(self, path): 1409 def __pathSelected(self, path):
1419 """ 1410 """
1420 Private slot called when a file is selected in the combobox. 1411 Private slot called when a file is selected in the combobox.
1421 1412
2223 self.tabWidget.setTabIcon(index, loading) 2214 self.tabWidget.setTabIcon(index, loading)
2224 self.statusBar().showMessage(self.trUtf8("Loading...")) 2215 self.statusBar().showMessage(self.trUtf8("Loading..."))
2225 2216
2226 self.__setLoadingActions(True) 2217 self.__setLoadingActions(True)
2227 2218
2228 def resetLoading(self, widget): 2219 def resetLoading(self, widget, ok):
2229 """ 2220 """
2230 Public method to reset the loading icon. 2221 Public method to reset the loading icon.
2231 2222
2232 @param widget reference to the widget to reset the icon for (QWidget) 2223 @param widget reference to the widget to reset the icon for (QWidget)
2224 @param ok flag indicating the result (boolean)
2233 """ 2225 """
2234 index = self.tabWidget.indexOf(widget) 2226 index = self.tabWidget.indexOf(widget)
2235 self.tabWidget.resetAnimation(index) 2227 self.tabWidget.resetAnimation(index)
2236 self.tabWidget.setTabIcon(index, widget.icon()) 2228 self.tabWidget.setTabIcon(index, widget.icon())
2237 self.statusBar().showMessage(self.trUtf8("Finished loading")) 2229 if ok:
2230 self.statusBar().showMessage(self.trUtf8("Finished loading"))
2231 else:
2232 self.statusBar().showMessage(self.trUtf8("Failed to load"))
2238 2233
2239 self.__setLoadingActions(False) 2234 self.__setLoadingActions(False)
2240 2235
2241 ############################################################################ 2236 ############################################################################
2242 ## Methods to support Webkit based browser below. 2237 ## Methods to support Webkit based browser below.

eric ide

mercurial