eric6/MicroPython/MicroPythonWidget.py

changeset 7161
728018c32b09
parent 7150
cfe71cde2eec
child 7229
53054eb5b15a
equal deleted inserted replaced
7159:85a9d6a753bd 7161:728018c32b09
1121 aw = e5App().getObject("ViewManager").activeWindow() 1121 aw = e5App().getObject("ViewManager").activeWindow()
1122 act.setEnabled(available and bool(aw)) 1122 act.setEnabled(available and bool(aw))
1123 self.__superMenu.addSeparator() 1123 self.__superMenu.addSeparator()
1124 if self.__device: 1124 if self.__device:
1125 self.__device.addDeviceMenuEntries(self.__superMenu) 1125 self.__device.addDeviceMenuEntries(self.__superMenu)
1126 self.__superMenu.addSeparator()
1127 act = self.__superMenu.addAction(
1128 self.tr("Show Documentation"), self.__showDocumentation)
1129 act.setEnabled(self.__device.hasDocumentationUrl())
1130 self.__superMenu.addSeparator()
1131 self.__superMenu.addAction(self.tr("Configure"), self.__configure)
1126 1132
1127 @pyqtSlot() 1133 @pyqtSlot()
1128 def __showDeviceVersion(self): 1134 def __showDeviceVersion(self):
1129 """ 1135 """
1130 Private slot to show some version info about MicroPython of the device. 1136 Private slot to show some version info about MicroPython of the device.
1380 1386
1381 self.__crossCompile( 1387 self.__crossCompile(
1382 pythonFile=aw.getFileName(), 1388 pythonFile=aw.getFileName(),
1383 title=self.tr("Compile Current Editor") 1389 title=self.tr("Compile Current Editor")
1384 ) 1390 )
1391
1392 @pyqtSlot()
1393 def __showDocumentation(self):
1394 """
1395 Private slot to open the documentation URL for the selected device.
1396 """
1397 if self.__device is None or not self.__device.hasDocumentationUrl():
1398 # abort silently
1399 return
1400
1401 url = self.__device.getDocumentationUrl()
1402 e5App().getObject("UserInterface").launchHelpViewer(url)
1403
1404 @pyqtSlot()
1405 def __configure(self):
1406 """
1407 Private slot to open the MicroPython configuration page.
1408 """
1409 e5App().getObject("UserInterface").showPreferences("microPythonPage")

eric ide

mercurial