eric6/MicroPython/MicroPythonWidget.py

changeset 7161
728018c32b09
parent 7150
cfe71cde2eec
child 7229
53054eb5b15a
--- a/eric6/MicroPython/MicroPythonWidget.py	Fri Aug 23 13:23:36 2019 +0200
+++ b/eric6/MicroPython/MicroPythonWidget.py	Fri Aug 23 14:49:59 2019 +0200
@@ -1123,6 +1123,12 @@
             self.__superMenu.addSeparator()
         if self.__device:
             self.__device.addDeviceMenuEntries(self.__superMenu)
+            self.__superMenu.addSeparator()
+            act = self.__superMenu.addAction(
+                self.tr("Show Documentation"), self.__showDocumentation)
+            act.setEnabled(self.__device.hasDocumentationUrl())
+        self.__superMenu.addSeparator()
+        self.__superMenu.addAction(self.tr("Configure"), self.__configure)
     
     @pyqtSlot()
     def __showDeviceVersion(self):
@@ -1382,3 +1388,22 @@
             pythonFile=aw.getFileName(),
             title=self.tr("Compile Current Editor")
         )
+    
+    @pyqtSlot()
+    def __showDocumentation(self):
+        """
+        Private slot to open the documentation URL for the selected device.
+        """
+        if self.__device is None or not self.__device.hasDocumentationUrl():
+            # abort silently
+            return
+        
+        url = self.__device.getDocumentationUrl()
+        e5App().getObject("UserInterface").launchHelpViewer(url)
+    
+    @pyqtSlot()
+    def __configure(self):
+        """
+        Private slot to open the MicroPython configuration page.
+        """
+        e5App().getObject("UserInterface").showPreferences("microPythonPage")

eric ide

mercurial